[gclist] Compiler improvments to help garbage collection.

David Chase chase@world.std.com
Thu, 07 Aug 1997 09:59:35 -0400

At 08:14 AM 8/7/97 -0500, Charles Fiterman wrote:
>There is an interesting article in a May 97 SIGPLAN PLDI "Automatic
>Inline Allocation of Objects". What this means is if class A has a 
>reference to class B and never exports the reference there doesn't have 
>to be a separate allocation for B its storage can be put in with the 
>storage for A.

>The other thing that struck me about the article is that instead of
>trying to maximize inlining of storage it might make sense to divide
>leaf objects, objects without pointers, from all pointer objects. This
>would mean a conservative collector was suddenly absolute and pages
>with leaf objects still don't get touched during collection. It looks
>like a good experiment.

This has been tried in the past.  The Boehm-Weiser collector has,
or had, two allocation entry points, and the Olivetti Modula-3 compiler
would allocate pointer-free data structures using the pointer-free-
storage collector.  This doesn't solve the problem for the stack,
and "mixed" (pointer and integer) data structures are still mixed.

One of the more entertaining bugs occurred when someone (in unsafe
Modula-3) loopholed some pointers into integers and stored them in
an array.  The array was stored in pointer-free storage, because its
type was pointer-free, the collector did not scan it, and all the
objects referenced by all those pointers were recycled.  Oops.

On another note, sorry for not keeping the GC FAQ more up to date.
I've been pretty busy.

David Chase
Natural Bridge LLC