[gclist] Integrating GC and Destructors (Finalizers?)

Robert A Duff bobduff@world.std.com
Sat, 16 Mar 1996 08:49:55 -0500


>    The  problem  I'm facing is determining or rather guaranteeing a certain
> order  in  which  the  objects  will  be  "destroyed",  ie.   the  order of
> destructor-calls made by the GC in a network of objects.

A rather long-winded discussion of this very issue has been taking place
on this list over the past week or so.  I presume the list is archived,
so you could look at the messages you missed if you want to?

It seems clear to me, at least, that "order is undefined" is not good
enough.

>    If  you  know  of any publications related to GC and treating the matter
> (maybe even my problem) well and in-depth, please mail me about it.  If you
> have  any  other  idea or know of a language in the ALGOL family where this
> problem  has been solved somehow, please also mail me or just answer to the
> list.

Ada 95 is part of the ALGOL family, and has a finalization feature.  (At
least that's what Ada calls it, although Hans Boehm has admonished me
that I've been using confusing/wrong terminology...)  There is at least
one Ada 95 compiler that has garbage collection, but it's not (yet?!)
common for Ada compilers to support gc.  During the language design,
*some* thought was given to the interactions between finalization and
gc, but not a *lot* of thought.  Anyway, in case you care, info on the
language is available online at sw-eng.falls-church.va.us via anonymous
FTP in directory public/adaic/docs/standard/95lrm_rat/v6.0.

>    As  you  might  have noticed in the subject line, I'm not sure where the
> exact difference between "destructor" and "finalizer" lies.  Please explain
> or hint me at a suitable FAQ file.

Me too.  Can somebody explain this to me?

- Bob