--- /opt/boost/include/boost/lockfree/queue.hpp 2013-04-05 14:01:03.581604550 +0100 +++ queue.hpp 2013-04-05 14:54:04.161603839 +0100 @@ -117,7 +117,29 @@ }; typedef typename detail::extract_allocator::type node_allocator; - typedef typename detail::select_freelist::type pool_t; + + struct initialised_node_allocator : node_allocator + { + initialised_node_allocator() + { + } + + initialised_node_allocator( const node_allocator& a ) : + node_allocator(a) + { + } + + typename node_allocator::pointer allocate( + typename node_allocator::size_type n, + typename node_allocator::const_pointer hint=0 ) + { + typename node_allocator::pointer p = node_allocator::allocate(n,hint); + memset(p,0,sizeof(*p)*n); + return p; + } + }; + + typedef typename detail::select_freelist::type pool_t; typedef typename pool_t::tagged_node_handle tagged_node_handle; typedef typename detail::select_tagged_handle::handle_type handle_type; @@ -191,7 +213,7 @@ explicit queue(size_type n): head_(tagged_node_handle(0, 0)), tail_(tagged_node_handle(0, 0)), - pool(node_allocator(), n + 1) + pool(initialised_node_allocator(), n + 1) { BOOST_ASSERT(!has_capacity); initialize();