Boost logo

Boost Users :

Subject: Re: [Boost-users] Interprocess : vectors of vectors
From: Oodini (svdbg____at_[hidden])
Date: 2013-05-14 09:09:06


> I am studybing this point.
> If you construct an empty vector in a managed shared memory, you have
> already 152 bytes consumed.
> I'd like to be sure that this value is always same.

Correction.
By applying the function get_free_memory(), I can see that as soon as you create the managed shared memory, you lose some bytes :

typedef allocator<int, Mngr> ShMemIntAllocator;
typedef vector<int, ShMemIntAllocator> MyVector;managed_shared_memory shmem(create_only, "name", 65536);

// shmem.get_free_memory() = 65384 -=> 152 bytes have been used
MyVector* vv = shmem.construct<MyVector>("Vector")(shmem.get_segment_manager());
// shmem.get_free_memory() = 65296-=> 88 bytes have been used

On Visual Studio 2010, an empty vector consumes 40 bytes.


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