Boost logo

Boost :

Subject: Re: [boost] [Block Pointer] Review Request
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2011-05-01 22:02:20


On Sun, May 1, 2011 at 6:52 PM, Phil Bouchard <philippe_at_[hidden]> wrote:
> On 5/1/2011 6:39 PM, Emil Dotchevski wrote:
>>
>> My point is that regardless of the order of destruction, if you have a
>> cycle, necessarily you will end up with some dangling pointers (smart
>> or otherwise). How does block_ptr protect against bugs arising from
>> that?
>
> When memory blocks are found to still exist after standard reference
> counting destruction then the remaining memory blocks are necessarily
> cyclic.  Each block part of the cyclic set will then be destroyed one at a
> time but if any other block_ptr are found to reference a block within the
> same set then the destruction of the block_ptr in question will be
> invalidated.  This is how an infinite destruction of a cyclic set is being
> prevented.

I'm not concerned with how cycles are being broken.

My question is, is there anything that protects all objects within a
cycle from being able to dereference a pointer to an object from the
cycle after that object has already been destroyed?

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


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