problem is compiler often don't known how programs organize objects, or, some memory pattern could not be known at compile time. and sometimes, delete point is very obvious in some programming models. finally i think developer should take their risk taking some unsafe operations by himself (like rust lang?)
Regards, cheng On Friday, May 28, 2021 at 12:00:56 PM UTC+8 Jesse McNelis wrote: > On Fri, May 28, 2021 at 12:56 PM cheng dong <qq451...@gmail.com> wrote: > >> to avoid false delete object, we could add some checking code in >> markDelete just like what we do with raceenable. >> one complicate case is internal pointer, we could recursively mark delete >> or mark delete internal pointer by hand ? >> > > This idea has come up many times over the past 10 yrs. The problem comes > down to: > 1. If we know that the markDelete is doing the delete in a memory safe > way, then we also know the life time of the object and can do the job of > markDelete automatically. > 2. If we don't know that the markDelete is doing the delete in a memory > safe way then we lose memory safety. > > Regards, > Jesse > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/a9e4488e-ef5e-49a8-ace4-ea65c6c0d5dbn%40googlegroups.com.