Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] Minimal size of a managed_shared_memory
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2013-06-24 15:15:05


El 24/06/2013 1:22, Oodini escribió:
> Hello,
>
> A managed_shared_memory is a typedef for a basic_managed_shared_memory using rbtree_best_fit as allocation algorithm.
>
> In the documentation :
>
> http://www.boost.org/doc/libs/1_53_0/doc/html/interprocess/memory_algorithms.html
>
> It is said at the and of the page : "In most 32 systems with 8 byte alignment the minimum size of a block is 24 byte".
>
> I am on Windows XP SP3 32 bits. The alignement is 8 byte. But if I create a managed_shared_memory with a size lesser than 120 bytes, my app crashes.
> This value comes from several get_min_size function, the deepest being in the rbtree_best_fit class.

The memory algorithm can't allocate less than 24 bytes, but the managed
shared memory class has internal members that need memory (say, the
internal mutex, internal container that points to named allocations,
etc. Those members also go to the segment.

Best,

Ion


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