Boost logo

Boost :

From: Phil Bouchard (philippe_at_[hidden])
Date: 2008-06-10 01:23:50

"Phil Bouchard" <philippe_at_[hidden]> wrote in message

> Now I added a PowerPoint presentation comparing the pointer with all other
> existing memory managers out there:
> sandbox/shifted_ptr/libs/example/doc/ShiftedPointer.ppt

Ok I just updated the doc again with a more complete version.

> While writing it I came to realize the mark & sweep algorithm is deleting
> objects even if they are still parent of an object still being referenced
> from the stack. Suppose for example I got a widget having a std::string
> as a member. This means if the stack refers to the buffer of the string
> but nobody points to the widget anymore then the string buffer will be
> deleted and thus a segfault will occur.


Sorry, this is a bad example. But imagine we have widgets piled up on each
other and the last one is a popup dialog box. If the only referenced one is
the popup one then all parent widget are going to be deleted if it is
handled by the mark & sweep algorithm.

Another example would be a this pointer being part of that parent object; no
pointers from the stack are referencing it only the this pointer being
cached in a register. Registers aren't handled by garbage collectors.


Boost list run by bdawes at, gregod at, cpdaniel at, john at