[LLVMdev] Garbage Collection Project

Talin viridia at gmail.com
Mon Jun 15 23:37:32 PDT 2009


A while back there was a discussion thread about whether an accurate, 
concurrent garbage collector could be "generic" in the sense of being 
able to support multiple different languages efficiently. After having 
done some work on this, I now believe that this is the case - using C++ 
policy-based design principles, you can create a set of modules that 
represent different aspects of collector behavior (such as 
mark-and-sweep, stop-the-world, and so on) along with different aspects 
of the runtime environment (object tracing strategies, heap structures, 
threading primitives, atomics), and encode these various behaviors as 
template classes which can be bound together to create an efficient 
collector.

The work I have done so far can be found here:

   http://code.google.com/p/scarcity/

At the moment, it's still in the "toy" stage, meaning you can run the 
unit tests and you can write toy languages that use concurrent garbage 
collection. It is by no means ready for real-world use. It does not yet 
have support for incremental or generational collection, nor does it 
have weak pointer or pinning support yet. It is not yet integrated with 
LLVM's garbage collection intrinsics, although that too is planned. 
There's also at least one data race bug lurking in the code somewhere, 
which I have not yet been able to tease out with valgrind.

The project is now at the stage where a small number of additional 
eyeballs would be useful, which is why I'm posting this here.

-- Talin




More information about the llvm-dev mailing list