Precise Garbage Collection for C [pdf]
cs.utah.edu
cs.utah.edu
Magpie is a source-to-source transformation for C programs that enables precise garbage collection, where precise means that integers are not confused with pointers
Later, to crush your hopes completely:
Precise GC requires that a C program obeys many restrictions - the same ones that apply to using conservative GC, and more - or the program can crash. For example, to use precise GC, a C program must never extract a pointer from a variable typed as long, at least not if a collection may have occurred since the value was stored in the variable.
Yeah, definitely not going to work with any large program that has been touched by an average C programmer.
These extra constraints are, however, satisfied by normal C programming practices.
-snort-
Also, the article says, "Custom allocators, in contrast, typically break these invariants permanently, because they allocate objects of statically unspecified shape in a block of primitively allocated memory." I'm not entirely sure, but it sounds like this means you can't use any library that uses a custom allocator. Certainly you'll have to manage resources from such libraries by hand. At that point you might as well use any garbage-collected language with a good C interface.
I agree that its application is limited (although I'm surprised they were able to convert even parts of the Linux kernel). But if I ever found myself implementing the runtime for a language with GC, I'd probably reach for this solution.