Boost logo

Boost Users :

Subject: [Boost-users] [Interprocess] Minimum allocation size for managed_shared_memorty
From: Aditya Gadre (agadre_at_[hidden])
Date: 2010-11-29 00:01:27


I have a question about Boost.Interprocess library. I am sharing a fixed
size boost::interprocess::vector using managed_shared_memory. The vector
length is 100 and the type of element in the vector is
boost::array<float, 2>. That makes
(vector::size)*sizeof(boost::array<float, 2> = 100*8 = 800. . If I
create a managed_shared_memory segment with length 800 bytes and create
a vector in that segment, then boost::interprocess::bad_alloc is thrown.
If however I create a segment with a length of say 8000 and then create
the vector, then everything works well. So my question is what is the
minimum size required for a managed_shared_memory segment apart from
what the size of a vector?
Thanks,
- Aditya


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