
29 Nov
2010
29 Nov
'10
5:01 a.m.
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