Freeing of memory (garbage collection)

Daniel White twinbee42 at skytopia.com
Tue Dec 9 11:53:25 PST 2008


Jarrett Billingsley Wrote:

> On Tue, Dec 9, 2008 at 11:08 AM, Daniel White <twinbee42 at skytopia.com> wrote:
> >> That would be a bad idea.  Then how would you do manual memory
> >> management in the few cases that absolutely require it?
> >
> > Two ways. Either:
> >
> > a: being able to lock the variable so that the garbage collector
> > can't touch it until you unlock it.
> 
> Why not just use GC-allocated memory and use addRoot then?

Well that question points at the deeper issue of why bother having malloc at all.


More information about the Digitalmars-d-learn mailing list