
14 May
2013
14 May
'13
1:09 p.m.
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.