> I actually have thought about aligning the heaps for fast lookup, as you
> suggested. But it's a bit hard to do that in practice. For example, the APIs
> for aligned memory allocation are not very portable.

Good point.  I'd suppose you'd have to 'overallocate' slightly or
something.  You could perhaps allocate heaps of 32K and have indices
every 1K pointing to the root.

> As for implementing a concurrent garbage collector, you *need* to have
> implemented write barriers. There are many papers on garbage collection, and
> I've noticed that it's pretty much impossible to implement anything more
> advanced than a simple mark-and-sweep unless you have write barriers.

Yeah--I'm just afraid to go there since matz mentioned once having
tried it and it slowed things down.  MRI would benefit from a total GC
rework, but this way works with the existing GC [at least mostly
works--gotta track down a bug in there, though all tests pass].

Thanks.
-=R