GC: finalization order?!

Simen kjaeraas simen.kjaras at gmail.com
Sun Feb 20 04:10:18 PST 2011


Jonathan M Davis <jmdavisProg at gmx.com> wrote:

> Yes. You're right. They can reference the non-GC heap just fine. It's  
> just that
> they can't reference the GC heap - probably because the destructor order  
> is
> indeterminate and so that the GC doesn't have to worry about dealing with
> circular references between garbage collected objects.

D could support finalizers in lieu of (or in addition to) destructors. In
such a case, they would be called before the object graph were garbage-
collected, and one could hence reference other objects on the GC heap. Is
there any reason why this approach was not chosen?

-- 
Simen


More information about the Digitalmars-d-learn mailing list