On Thursday 01 November 2001 09:08 pm, Ken Fox wrote: > Michael L Maraist wrote: > [an incredible amount of detailed information that will > take me weeks to digest...] > > This looks like a malloc/free style allocator. Since the whole > GC system for Parrot is on the table, you don't have to constrain > yourself to malloc/free. IMHO free is not needed at all -- we > should be scavenging entire arenas all at once. I assume you > want to use malloc to grab an arena, but carving up the arena is > the GC's job.
The first couple paragraphs summarize what's going on, but malloc and free aren't even really even used in this memory manager. Basically it's an arena type scheme (though SUN didn't use the word arena, I don't think), that works very well in multi-threading, by breaking the problem into multiple layers so as to avoid fragmentation, thread-contention, consolidation, and most importantly provides constant-access time (even in the worst possible case). There is a generic alloc/free interface in the back-end (which will most certainly be necessary when interfacing with c-code), and when utilizing dynamic memory sized objects (such as dynamicly resizable arrays), but most access is via interpreter specific arena's which minimizes thread-slack-space through the involved interaction of layers. More-over, the "object caching scheme" allows complex data-types to avoid repeated destruction / construction cycles. (Though primarily useful within an OS, as was it's original target) As with the relationship to the GC, my vision was that the GC would free memory objects as it found them unused (mark/sweep or what-ever), which only hands the memory regions over to the deallocator, which intelligently makes decisions about what to do with it, and how to appropriately buffer. Further, this resource management scheme provides interfaces for reclaiming memory when necessary; something obviously needed by a GC. One key aspect, however is that this provides so many features otherwise required by a GC that the GC is greatly simplified, and thus lends to greater possibilities. The main focus is on memory efficiency and performance.. -Michael -Michael