[gclist] half flips

James McCartney asynth at io.com
Wed Aug 4 14:06:54 PDT 2004

On Aug 3, 2004, at 10:07 PM, Mark Stuart Johnstone wrote:

> We allocated black so that they would not be scanned in the current
> marking process.  This gives them a little time to die.  We were thus
> using the huristic that an existing object is likely to point to
> several new objects in turn.  If we allocate these black, we don't
> have to scan them during the current marking phase.

But you do have to scan any white objects that get installed into these 
black objects. I would say in most programming languages it is the case 
that new objects are created and are immediately initialized with old 
objects. And that this is far more frequent than old objects having new 
objects being written into them. So I think for programming language 
implementations that allocate black is not a good strategy.

> We were assuming
> that there would be cases where a data structure is built and dies
> before the next marking phase starts.

If you allocate white then there is also a chance you will never scan 
it if it becomes garbage during the collection cycle.

The idea with half flips is not having to rescan the root objects, that 
you know will be alive, every cycle.

> As to whether this is actually
> any better than allocating white, we have no data (read: your guess is
> as good as mine 8-).

--- james mccartney   james at audiosynth.com   <http://www.audiosynth.com>
SuperCollider - a real time audio synthesis programming language

More information about the GClist mailing list