Boost logo

Boost :

Subject: Re: [boost] [Block Pointer] Review Request
From: Phil Bouchard (philippe_at_[hidden])
Date: 2011-05-01 21:16:55


On 5/1/2011 6:01 PM, Emil Dotchevski wrote:
>
> The way to deal with this situation using shared_ptr is to use
> weak_ptr to break the cycles. I suppose block_ptr solves this problem
> more elegantly, but how?

The way it is being handled is explained here:
https://svn.boost.org/svn/boost/sandbox/block_ptr/libs/smart_ptr/doc/rationale.html#cyclicism

If blocks of memory are found to still exist after a standard reference
counter destruction and that the pointer is living on the stack or data
segment then each memory blocks will be destructed and deallocated in
the order they were constructed (FIFO). Everything is being handled
implicitly.

-Phil


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk