
2 May
2011
2 May
'11
1:52 a.m.
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. (A set is a group of memory blocks). -Phil