[Boost-bugs] [Boost C++ Libraries] #11490: boost::lockfree::spsc_queue::pop(T*, size_type) did not compile when used with interprocess allocator

Subject: [Boost-bugs] [Boost C++ Libraries] #11490: boost::lockfree::spsc_queue::pop(T*, size_type) did not compile when used with interprocess allocator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-07-21 13:20:42


#11490: boost::lockfree::spsc_queue::pop(T*, size_type) did not compile when used
with interprocess allocator
---------------------------------------+--------------------------
 Reporter: Philippe Leuba <pleuba@…> | Owner: timblechmann
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: lockfree
  Version: Boost 1.58.0 | Severity: Showstopper
 Keywords: |
---------------------------------------+--------------------------
 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:

 /usr/local/include/boost/lockfree/spsc_queue.hpp: In instantiation of
 â€˜boost::lockfree::detail::runtime_sized_ringbuffer<T, Alloc>::size_type
 boost::lockfree::detail::runtime_sized_ringbuffer<T, Alloc>::pop(T*,
 boost::lockfree::detail::runtime_sized_ringbuffer<T, Alloc>::size_type)
 [with T = int; Alloc = boost::interprocess::allocator<int,
 boost::interprocess::segment_manager<char,
 boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,
 boost::interprocess::iset_index> >;
 boost::lockfree::detail::runtime_sized_ringbuffer<T, Alloc>::size_type =
 long unsigned int]’:
 /usr/local/include/boost/lockfree/spsc_queue.hpp:556:27: required from
 â€˜boost::lockfree::detail::runtime_sized_ringbuffer<T,
 Alloc>::~runtime_sized_ringbuffer() [with T = int; Alloc =
 boost::interprocess::allocator<int,
 boost::interprocess::segment_manager<char,
 boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,
 boost::interprocess::iset_index> >]’
 /usr/local/include/boost/lockfree/spsc_queue.hpp:679:7: required from
 â€˜void
 boost::interprocess::ipcdetail::placement_destroy<T>::destroy_n(void*,
 std::size_t, std::size_t&) [with T = boost::lockfree::spsc_queue<int,
 boost::lockfree::allocator<boost::interprocess::allocator<int,
 boost::interprocess::segment_manager<char,
 boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,
 boost::interprocess::iset_index> > > >; 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<int,
 boost::interprocess::allocator<int,
 boost::interprocess::segment_manager<char,
 boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,
 boost::interprocess::iset_index> > >::pop(int*&,
 boost::lockfree::detail::runtime_sized_ringbuffer<int,
 boost::interprocess::allocator<int,
 boost::interprocess::segment_manager<char,
 boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,
 boost::interprocess::iset_index> > >::size_type&,
 boost::lockfree::detail::runtime_sized_ringbuffer<int,
 boost::interprocess::allocator<int,
 boost::interprocess::segment_manager<char,
 boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,
 boost::interprocess::iset_index> > >::pointer&,
 boost::lockfree::detail::runtime_sized_ringbuffer<int,
 boost::interprocess::allocator<int,
 boost::interprocess::segment_manager<char,
 boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,
 boost::interprocess::iset_index> > >::size_type&)’
          return ringbuffer_base<T>::pop(ret, size, array_, max_elements_);
                                                                         ^
 /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<T>::size_t
 boost::lockfree::detail::ringbuffer_base<T>::pop(T*,
 boost::lockfree::detail::ringbuffer_base<T>::size_t, T*,
 boost::lockfree::detail::ringbuffer_base<T>::size_t) [with T = int;
 boost::lockfree::detail::ringbuffer_base<T>::size_t = long unsigned int]
      size_t pop (T * output_buffer, size_t output_count, T *
 internal_buffer, size_t max_size)
             ^
 /usr/local/include/boost/lockfree/spsc_queue.hpp:263:12: note: no known
 conversion for argument 3 from
 â€˜boost::lockfree::detail::runtime_sized_ringbuffer<int,
 boost::interprocess::allocator<int,
 boost::interprocess::segment_manager<char,
 boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,
 boost::interprocess::iset_index> > >::pointer {aka
 boost::interprocess::offset_ptr<int, long int, long unsigned int, 0ul>}’
 to ‘int*’

 I have attached a small test to reproduce the problem and a patch, but
 other method seems to suffer from the same problem.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11490>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC