gc tweaks

Matthew Fluet mfluet@intertrust.com
Wed, 22 Aug 2001 09:17:31 -0700 (PDT)


> > I'm thinking of trying a simple re-write of the GC  just  to
> > see  what I can get from low level tweaks.  For more serious stuff on the GC,
> > it would be great if there were a bit in the header  of  objects  that  would
> > tell  me  if it was mutable or not.
>
> This should be easy enough to add.

If we're going to tweak the object headers, it might be worth stealing one
or two bits for alignment hints (i.e., getting doubles to be mod 8
aligned).

> > This could be used in two distinct ways.
> > One would be for the generational GC,  which  needs  to  know  about  mutable
> > objects.    The  other  would  be  to  implement  something  that  I  had  in
> > Mathematica: the `share' function.  When you call it on  a  data  object,  it
> > returns  a  copy of that object which maximizes sharing.  In Mathematica, you
> > could also call it on no arguments, which meant do this to the  entire  heap.
> > This  was  great  for  saving  space  at judicious moments.  (In Mathematica,
> > although a real piece of junk, all the heap was immutable.)
>
> share sounds cool.  I wonder how much it would buy in the compiler itself.

Maybe my coffee just hasn't kicked in yet, but how does `share' work?
Some kind of common-subobject-elimination?  It just seems that the
equality test would be prohibitively expensive.