Boost C++ Libraries: Ticket #11490: boost::lockfree::spsc_queue::pop(T*, size_type) did not compile when used with interprocess allocator https://svn.boost.org/trac10/ticket/11490 <p> The method runtime_sized_ringbuffer::pop(T*, size_type) when used with interprocess allocator produces the following error when compiled with g++ 4.9.1 under linux: </p> <p> /usr/local/include/boost/lockfree/spsc_queue.hpp: In instantiation of ‘boost::lockfree::detail::runtime_sized_ringbuffer&lt;T, Alloc&gt;::size_type boost::lockfree::detail::runtime_sized_ringbuffer&lt;T, Alloc&gt;::pop(T*, boost::lockfree::detail::runtime_sized_ringbuffer&lt;T, Alloc&gt;::size_type) [with T = int; Alloc = boost::interprocess::allocator&lt;int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family&gt;, boost::interprocess::iset_index&gt; &gt;; boost::lockfree::detail::runtime_sized_ringbuffer&lt;T, Alloc&gt;::size_type = long unsigned int]’: /usr/local/include/boost/lockfree/spsc_queue.hpp:556:27: required from ‘boost::lockfree::detail::runtime_sized_ringbuffer&lt;T, Alloc&gt;::~runtime_sized_ringbuffer() [with T = int; Alloc = boost::interprocess::allocator&lt;int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family&gt;, boost::interprocess::iset_index&gt; &gt;]’ /usr/local/include/boost/lockfree/spsc_queue.hpp:679:7: required from ‘void boost::interprocess::ipcdetail::placement_destroy&lt;T&gt;::destroy_n(void*, std::size_t, std::size_t&amp;) [with T = boost::lockfree::spsc_queue&lt;int, boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family&gt;, boost::interprocess::iset_index&gt; &gt; &gt; &gt;; std::size_t = long unsigned int]’ spsc_queue_interprocess_test.cpp:33:1: required from here /usr/local/include/boost/lockfree/spsc_queue.hpp:609:72: error: no matching function for call to ‘boost::lockfree::detail::runtime_sized_ringbuffer&lt;int, boost::interprocess::allocator&lt;int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family&gt;, boost::interprocess::iset_index&gt; &gt; &gt;::pop(int*&amp;, boost::lockfree::detail::runtime_sized_ringbuffer&lt;int, boost::interprocess::allocator&lt;int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family&gt;, boost::interprocess::iset_index&gt; &gt; &gt;::size_type&amp;, boost::lockfree::detail::runtime_sized_ringbuffer&lt;int, boost::interprocess::allocator&lt;int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family&gt;, boost::interprocess::iset_index&gt; &gt; &gt;::pointer&amp;, boost::lockfree::detail::runtime_sized_ringbuffer&lt;int, boost::interprocess::allocator&lt;int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family&gt;, boost::interprocess::iset_index&gt; &gt; &gt;::size_type&amp;)’ </p> <blockquote> <p> return ringbuffer_base&lt;T&gt;::pop(ret, size, array_, max_elements_); </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/include/boost/lockfree/spsc_queue.hpp:609:72: note: candidate is: /usr/local/include/boost/lockfree/spsc_queue.hpp:263:12: note: boost::lockfree::detail::ringbuffer_base&lt;T&gt;::size_t boost::lockfree::detail::ringbuffer_base&lt;T&gt;::pop(T*, boost::lockfree::detail::ringbuffer_base&lt;T&gt;::size_t, T*, boost::lockfree::detail::ringbuffer_base&lt;T&gt;::size_t) [with T = int; boost::lockfree::detail::ringbuffer_base&lt;T&gt;::size_t = long unsigned int] </p> <blockquote> <p> size_t pop (T * output_buffer, size_t output_count, T * internal_buffer, size_t max_size) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> /usr/local/include/boost/lockfree/spsc_queue.hpp:263:12: note: no known conversion for argument 3 from ‘boost::lockfree::detail::runtime_sized_ringbuffer&lt;int, boost::interprocess::allocator&lt;int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family&gt;, boost::interprocess::iset_index&gt; &gt; &gt;::pointer {aka boost::interprocess::offset_ptr&lt;int, long int, long unsigned int, 0ul&gt;}’ to ‘int*’ </p> <p> I have attached a small test to reproduce the problem and a patch, but other method seems to suffer from the same problem. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11490 Trac 1.4.3 Philippe Leuba <pleuba@…> Tue, 21 Jul 2015 13:25:18 GMT attachment set https://svn.boost.org/trac10/ticket/11490 https://svn.boost.org/trac10/ticket/11490 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">spsc_queue_interprocess_test.cpp</span> </li> </ul> <p> Test to reproduce the problem </p> Ticket Philippe Leuba <pleuba@…> Tue, 21 Jul 2015 13:25:41 GMT attachment set https://svn.boost.org/trac10/ticket/11490 https://svn.boost.org/trac10/ticket/11490 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_1_58_0.patch</span> </li> </ul> <p> Patch </p> Ticket Philippe Leuba <pleuba@…> Tue, 21 Jul 2015 13:27:40 GMT cc set https://svn.boost.org/trac10/ticket/11490#comment:1 https://svn.boost.org/trac10/ticket/11490#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">pleuba@…</span> added </li> </ul> Ticket Philippe Leuba <pleuba@…> Tue, 06 Oct 2015 09:05:21 GMT <link>https://svn.boost.org/trac10/ticket/11490#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11490#comment:2</guid> <description> <p> 3 months ago, I submitted a patch for this bug. </p> <p> Can someone have a look on it and if agreed, commit it to the trunk for next release. </p> <p> Philippe </p> </description> <category>Ticket</category> </item> <item> <dc:creator>timblechmann</dc:creator> <pubDate>Sat, 17 Oct 2015 11:26:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11490#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11490#comment:3</guid> <description> <p> can you submit a pull request on github? </p> <p> thnx </p> </description> <category>Ticket</category> </item> <item> <author>Philippe Leuba <pleuba@…></author> <pubDate>Wed, 06 Jan 2016 12:37:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11490#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11490#comment:4</guid> <description> <p> Pull request created </p> </description> <category>Ticket</category> </item> </channel> </rss>