Boost Users :
Subject: Re: [Boost-users] Boost Shared Memory Compilation Issue
From: TONGARI (tongari95_at_[hidden])
Date: 2011-07-27 15:03:20
2011/7/28 Nathan Lewis <nathanlewissubscription_at_[hidden]>
> TONGARI <tongari95 <at> gmail.com> writes:
> > Generally, you should not deallocate what you didn't allocate by
> the container's job to deallocate its elems, and it's your job to destruct
> container when you don't need it anymore, like:
> Lots of good learning points I appreciate the learning opportunity. So is
> you are explaining is that one would just pop the elements out of the
> vector and
> then they would be deleted when this call is made by the resource that
> "owns" it
> and is done with it:
> Or are you explaining that when the pop is called, the internals of the
> implementation invokes the destruction of the object.
Yes. And the allocation/deallocation is performed by the container, say,
ComplexDataVector, when it needs to adjust its internal storage.
segment.destroy<...>(...) will destruct the found object and deallocate the
It's analog of "delete".
I so appreciate your responses, it has been tremendously helpful. Working
> Boost Interprocess has made me think a lot more about the
> allocation/deallocation process that tends to get abstracted away but is
> in understanding.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net