Ticket #4230: boost-interprocess-fixes.patch

File boost-interprocess-fixes.patch, 1.8 KB (added by Douglas Gregor, 12 years ago)

Patch to fix two problems with Boost.Interprocess

  • allocators/detail/allocator_common.hpp

     
    290290      //Deallocate all new linked list at once
    291291      mp_node_pool->deallocate_nodes(boost::interprocess::move(chain));
    292292   }
     293
     294public:
     295  void swap(cache_impl &other) {
     296    detail::do_swap(mp_node_pool, other.mp_node_pool);
     297    m_cached_nodes.swap(other.m_cached_nodes);
     298    detail::do_swap(m_max_cached_nodes, other.m_max_cached_nodes);
     299  }
    293300};
    294301
    295302template<class Derived, class T, class SegmentManager>
     
    657664   //!different shared memory segments, the result is undefined.
    658665   friend void swap(cached_allocator_impl &alloc1, cached_allocator_impl &alloc2)
    659666   {
    660       detail::do_swap(alloc1.mp_node_pool,       alloc2.mp_node_pool);
    661       alloc1.m_cached_nodes.swap(alloc2.m_cached_nodes);
    662       detail::do_swap(alloc1.m_max_cached_nodes, alloc2.m_max_cached_nodes);
     667     alloc1.m_cache.swap(alloc2.m_cache);
    663668   }
    664669
    665670   void deallocate_cache()
  • containers/container/detail/adaptive_node_pool_impl.hpp

     
    6969         const bool is_equal = l.free_nodes.size() == r.free_nodes.size();
    7070         return is_less || (is_equal && (&l < &r));
    7171      }
     72
     73     friend bool operator ==(const block_info_t &l, const block_info_t &r) {
     74       return &l == &r;
     75     }
     76
    7277   };
    7378   typedef typename bi::make_multiset
    7479      <block_info_t, bi::base_hook<multiset_hook_t> >::type  block_multiset_t;