On 11/23/2012 11:17 AM, Joern Rennecke wrote:
How about we require that in general, use of raw pointers to GC-able objects are banned, and instead we require the use of a class (maybe obtained by template?) that is a pointer to the GC-able object, with a special copy-constructor. The copy-constructor marks the pointed - to object as live. GC traverses an object by performing a dummy copy and destroying it.
This will require *a* *lot* of stack space for the recursion, and cycle detection probably has to rely on undefined behavior. I'm pretty sure there are other drawbacks as well.
The beauty of Cheney's scheme is that it uses the from space as a work queue, and I don't see how we can do something similar in mostly portable C++. (That being said, we could probably use Boehm GC for the bootstrap compiler and a different collector after bootstrapping.)
-- Florian Weimer / Red Hat Product Security Team