Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost Shared Memory Compilation Issue
From: Nathan Lewis (nathanlewissubscription_at_[hidden])
Date: 2011-07-27 14:31:41


TONGARI <tongari95 <at> gmail.com> writes:

>
>
> Generally, you should not deallocate what you didn't allocate by yourself.It's
the container's job to deallocate its elems, and it's your job to destruct the
container when you don't need it anymore, like:
segment.destroy<ComplexDataVector>("ComplexDataVector");
>

Lots of good learning points I appreciate the learning opportunity. So is what
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:
segment.destroy<ComplexDataVector>("ComplexDataVector");

Or are you explaining that when the pop is called, the internals of the vector
implementation invokes the destruction of the object.

I so appreciate your responses, it has been tremendously helpful. Working with
Boost Interprocess has made me think a lot more about the
allocation/deallocation process that tends to get abstracted away but is useful
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