Proposal: GC and "delete"

Brian White bcwhite at pobox.com
Sun Apr 6 01:13:25 PDT 2008


> The only time you would have user code running while the GC is running 
> is in a destructor, and you shouldn't be accessing heap objects that 
> potentially need to be deleted from the destructor anyway, since the 
> order of destruction is unpredictable.

Which was exactly the problem I was trying to address.  Sometimes (like 
with RAII), you want an object destructed when it goes out of scope and 
if that object contains other RAII objects, they must be 
deleted/destructed, too.

However, I think I've got a better idea.  Give me some time to write it 
up...

-- Brian



More information about the Digitalmars-d mailing list