Boost C++ Libraries: Ticket #6764: rbtree_best_fit breaks if allocation alignment doesn't match the segment manager alignment https://svn.boost.org/trac10/ticket/6764 <p> I have a shared memory queue. The memory segment is divided into 3 parts: a header, a fixed number of element descriptors and an area available for element bodies. The latter is managed by a segment manager with the rbtree_best_fit allocation strategy, which is initialized so that it doesn't use the area with the element descriptors. </p> <p> If the allocation strategy uses default alignment settings, everything works as expected. But if a stricter alignment requirement is specified (32 bytes in my case), the rbtree_best_fit::priv_add_segment function fails with assertion failure 'priv_end_block() == end_block'. </p> <p> Apparently, the root of the issue is in the fact that the segment manager itself in my case is not aligned to 32 bytes (but is aligned sufficiently to be operated on). This configuration worked fine with Boost 1.46 but fails with 1.48. I think, such configuration is valid and the code should be made to support it. </p> <p> I have attached a test case that demonstrates the issue. I'm running on Linux, x86-64, gcc 4.6. </p> <p> PS: I also have a side question. As you may see in the code, I try to estimate the shared memory segment size to allocate. I assume the segment manager will add an overhead per allocation for its bookkeeping but I failed to see how I can discover the amount of this overhead, so I hardcoded 64 bytes. Is there a better way to do this? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6764 Trac 1.4.3 Andrey Semashev Thu, 05 Apr 2012 08:12:26 GMT attachment set https://svn.boost.org/trac10/ticket/6764 https://svn.boost.org/trac10/ticket/6764 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">segment_manager_test.cpp</span> </li> </ul> <p> The test case that demonstrates the problem. </p> Ticket Andrey Semashev Fri, 04 Apr 2014 09:50:15 GMT <link>https://svn.boost.org/trac10/ticket/6764#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6764#comment:1</guid> <description> <p> Any news about this ticket? </p> </description> <category>Ticket</category> </item> </channel> </rss>