From: William E. Kempf (wekempf_at_[hidden])
Date: 2003-01-07 10:54:32
> From: "Peter Dimov" <pdimov_at_[hidden]>
> I've added a simple mark and sweep "garbage collector" to
> libs/smart_ptr/sp_debug_hooks.cpp that is able to detect unreachable objects
> kept alive by shared_ptr cycles. At the moment it's more a debugging aid,
> and doesn't attempt to free memory, athough it is possible to extend it to
> do so. This is mainly a research project; if you think that it might have a
> practical use let me know. :-)
I think that extending it to free memory in cycles would be a great idea. Of course, this opens a large can of worms about how to handle destruction of objects which refer to each other...
I think that full GC is one of the major things missing from the C++ language, and the appeal of a smart pointer approach, where I pay for GC only when I want/need it, is a great idea.
William E. Kempf
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk