Jonathan M Davis <[email protected]> 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