[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Dec 30 16:35:26 2003 
Subject:Re: Comparing Garbage Collectors 
From:steve 
Volume-ID:1031230.02 

Hi,

David writes about oldarray:
>I thought I'd mention my contribution to this, since it took a lot of
>thought to get it right, but I believe I did get it right in the end.
 <snip>
>http://www.cs.bham.ac.uk/research/poplog/popvision/lib/oldarray.p
>http://www.cs.bham.ac.uk/research/poplog/popvision/help/oldarray

That is very clever - a reallocator that cooperates with the GC.

But this might be a stupid idea but I'll suggest it anyway.  Why not
invent a special tag type like this?

  ;;; Choose a better name ... this name chosen to match the
  ;;; documentation.
  defclass OldArrayTag {};

  procedure( bounds, tag );
      oldanyarray( tag, bounds, vector_key )
  endprocedure -> class_apply( OldArrayTag_key );

And you get this idiom:

  lconstant oldarray1 = newOldArrayTag();
  ...
  lvars array = oldarray1( bounds );

I think it is a more elegant way to package up the tag.  The tag now represents
a reallocator which is quite a nice idea.  You've lost nothing because you
can still write

  oldanyarray( oldarray1, bounds, key ) -> array

for the full generality.  But maybe I am just missing the whole point ..... ?

-- 
Steve