One reason why I love writing, both in blogs and on Wikibooks, is because it forces me to really understand things. Having to put a concept into actual words, my own words, requires that I have a concrete understanding of that concept. My previous blog entry is a case in point: I wrote a post that didn't make a whole lot of sense, there were some comments, I posted some replies, and in the process I developed a much firmer picture of this whole GC project.
A lot of my misunderstanding stems from terminology problems. Here's an example: In parrot there is a data structure called "Arenas" which maintains pointers to all the pools. "Pools" are memory areas from which allocations can be made, and are typically defined by the data structure "Small_Object_Pool". Each pool contains a specific type of thing, typically with uniform size. There are 6 pools for objects: PMCs, Constant PMCs, Extended PMCs, Buffer headers, String headers, and constant string headers. The Arenas structure also contains a few GC-related function pointers, and some data items that can be used by the GC.
Small_Object_Pool objects contain pointers to a data structure called a Small_Object_Arena, which is used to demarcate sections of the pool (for what ultimate purpose, however, I am not sure). The Small_Object_Pool also contains pointers to Memory_Pool objects, which are the low-level storage implementations.
So when we talk about "Arenas", it's not immediately clear whether we mean "struct Arenas" or "struct Small_Object_Arena". When we say "Pool", it's not immediately obvious whether we mean a Small_Object_Pool or a Memory_Pool. When we talk about headers, we could mean "Gc_it_hdr" (from the garbage collector) or buffer headers, or PMC headers. See the confusion?
The GC operates per-pool, or pool-at-a-time (I'm treating the two as equivalent terms). When we need new PMC headers, we scan through the PMC pool. When we need new buffer headers, we scan that pool instead. Each pool, since it represents a distinct situation for the GC, gets it's own GC-related structures: generations, cardmarking bitmaps, etc. I'm having to redo all the data structures that I had created previously to follow these relationships.
The allocators that I have to write are also written per-pool, although other GCs have reused code for these and I'm going to do the same. I want to get those knocked out tonight or tomorrow, and I don't see any major impediments to that.