|
Boost : |
From: Phil Bouchard (philippe_at_[hidden])
Date: 2008-06-09 04:59:34
"Phil Bouchard" <philippe_at_[hidden]> wrote in message
news:g2b1pp$pir$1_at_ger.gmane.org...
> Ok I just added a skeleton for a STL compliant allocator called
> "shifted_allocator" in "sh_owned_base_nt.hpp" of my sandbox. This is an
> example of how it should be written, unfortunately I wasn't able to make
> it compile but this is basically the final step. There are some FIXME in
> the header and shifted_ptr_test2.cpp file.
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
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.
On the other hand one feature I really like from the garbage collector is
that one might use it to silently replace all malloc() and free() from an
existing C project without the need to rewrite any code. I think this is a
nice feature and I would encourage people using it more in that matter.
Thanks,
-Phil
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk