Destructors and Deterministic Memory Management

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Wed May 6 23:52:44 PDT 2009


Daniel Keep wrote:
> 
> Frits van Bommel wrote:
>> Daniel Keep wrote:
>>> When your class' dtor is called, you CANNOT say whether any of the
>>> references into GC-controlled memory you hold are still valid.
>> You forgot to add: unless you know for a *fact* they're referenced from
>> a GC root, for example from a global variable (directly or indirectly).
> 
> Or there's an integer somewhere that LOOKS like a pointer to it ...  I
> was talking from the perspective of NOT having any information outside
> of the object itself.  :P

No, you can't assume this one. For all you know, your program might one day be 
compiled with a (semi-)precise GC :).



More information about the Digitalmars-d mailing list