Garbage Collection, Allocators/Deallocators and

Ivo Kasiuk i.kasiuk at gmx.de
Sat Sep 18 13:54:18 PDT 2010


> > Exploring the example a bit further:
> > If C's malloc is used instead of GC.malloc then the deallocators also
> > are not called and the program runs out of memory. How are the objects
> > supposed to get finalized in this case - do I have to use the delete
> > keyword explicitly?
> 
> If you use C's malloc, you will also have to use C's free.

Yes, obviously. But the deallocator which contains the call to C's free
has to be invoked by someone, otherwise it's useless. So that is my
question: how should finalization and deallocation get triggered in this
scenario (where non-GC memory is used)?



More information about the Digitalmars-d-learn mailing list