|
Boost : |
From: Gregory Colvin (gregory.colvin_at_[hidden])
Date: 2003-05-29 11:17:56
On Thursday, May 29, 2003, at 09:57 America/Denver, Larry Evans wrote:
> Gregory Colvin wrote:
> [snip]
>> It seems that rather than take the route of modifying all the
>> standard containers one might as well just provide a special
>> operator new(gc) and gc_allocator that can track all the memory
>> blocks on the heap that might contain a shared_ptr. Then one
>> can either replace global operator new with the special one,
>> or use new(gc) or gc_allocator wherever needed.
> I'm assuming that the advantage of the suggested method
> over Boehm's collector would be the precision? I.e. no
> false pointers are possible?
Yes, that would be one (small) advantage. It would also be
easier to provide a portable version. The disadvantage is
the need to use smart pointers at all.
It is not that hard to write a new(gc) and gc_allocator
using Boehm's collector, for those who don't want to have
the collector take over all memory allocation.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk