mirror of
https://github.com/boostorg/interprocess.git
synced 2026-01-19 04:12:13 +00:00
Use public Boost.Container API for uses-allocator construction instead of the detail utilities
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
#include <boost/interprocess/allocators/detail/allocator_common.hpp>
|
||||
|
||||
#include <boost/container/detail/multiallocation_chain.hpp>
|
||||
#include <boost/container/detail/dispatch_uses_allocator.hpp>
|
||||
#include <boost/container/uses_allocator_construction.hpp>
|
||||
#include <boost/container/detail/addressof.hpp>
|
||||
|
||||
#include <boost/move/adl_move_swap.hpp>
|
||||
@@ -190,9 +190,8 @@ class adaptive_pool_base
|
||||
template < typename U, class ...Args>
|
||||
inline void construct(U* p, Args&& ...args)
|
||||
{
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;
|
||||
boost::container::dtl::dispatch_uses_allocator
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p, ::boost::forward<Args>(args)...);
|
||||
boost::container::uninitialized_construct_using_allocator
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()), ::boost::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
#else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
||||
@@ -201,9 +200,8 @@ class adaptive_pool_base
|
||||
template < typename U BOOST_MOVE_I##N BOOST_MOVE_CLASSQ##N >\
|
||||
void construct(U* p BOOST_MOVE_I##N BOOST_MOVE_UREFQ##N)\
|
||||
{\
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;\
|
||||
boost::container::dtl::dispatch_uses_allocator\
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
boost::container::uninitialized_construct_using_allocator\
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()) BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
}\
|
||||
//
|
||||
BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_ALLOCATORS_ADAPTIVE_POOL_CONSTRUCT_CODE)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#include <boost/container/detail/placement_new.hpp>
|
||||
#include <boost/container/detail/addressof.hpp>
|
||||
#include <boost/container/detail/dispatch_uses_allocator.hpp>
|
||||
#include <boost/container/uses_allocator_construction.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
#include <stdexcept>
|
||||
@@ -183,9 +183,8 @@ class allocator
|
||||
template < typename U, class ...Args>
|
||||
inline void construct(U* p, Args&& ...args)
|
||||
{
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;
|
||||
boost::container::dtl::dispatch_uses_allocator
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p, ::boost::forward<Args>(args)...);
|
||||
boost::container::uninitialized_construct_using_allocator
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()), ::boost::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
#else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
||||
@@ -194,9 +193,8 @@ class allocator
|
||||
template < typename U BOOST_MOVE_I##N BOOST_MOVE_CLASSQ##N >\
|
||||
void construct(U* p BOOST_MOVE_I##N BOOST_MOVE_UREFQ##N)\
|
||||
{\
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;\
|
||||
boost::container::dtl::dispatch_uses_allocator\
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
boost::container::uninitialized_construct_using_allocator\
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()) BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
}\
|
||||
//
|
||||
BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_ALLOCATORS_ALLOCATOR_CONSTRUCT_CODE)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <boost/interprocess/detail/utilities.hpp>
|
||||
#include <boost/interprocess/containers/version_type.hpp>
|
||||
|
||||
#include <boost/container/detail/dispatch_uses_allocator.hpp>
|
||||
#include <boost/container/uses_allocator_construction.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
|
||||
#include <boost/container/detail/placement_new.hpp>
|
||||
#include <boost/container/detail/dispatch_uses_allocator.hpp>
|
||||
#include <boost/container/uses_allocator_construction.hpp>
|
||||
#include <boost/container/detail/multiallocation_chain.hpp>
|
||||
#include <boost/container/detail/addressof.hpp> //boost::container::dtl:addressof
|
||||
|
||||
@@ -657,9 +657,8 @@ class cached_allocator_impl
|
||||
template < typename U, class ...Args>
|
||||
inline void construct(U* p, Args&& ...args)
|
||||
{
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;
|
||||
boost::container::dtl::dispatch_uses_allocator
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p, ::boost::forward<Args>(args)...);
|
||||
boost::container::uninitialized_construct_using_allocator
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()), ::boost::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
#else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
||||
@@ -668,9 +667,8 @@ class cached_allocator_impl
|
||||
template < typename U BOOST_MOVE_I##N BOOST_MOVE_CLASSQ##N >\
|
||||
void construct(U* p BOOST_MOVE_I##N BOOST_MOVE_UREFQ##N)\
|
||||
{\
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;\
|
||||
boost::container::dtl::dispatch_uses_allocator\
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
boost::container::uninitialized_construct_using_allocator\
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()) BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
}\
|
||||
//
|
||||
BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_ALLOCATORS_ALLOCATOR_COMMON_CONSTRUCT_CODE)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <boost/interprocess/detail/type_traits.hpp>
|
||||
|
||||
|
||||
#include <boost/container/detail/dispatch_uses_allocator.hpp>
|
||||
#include <boost/container/uses_allocator_construction.hpp>
|
||||
#include <boost/container/detail/multiallocation_chain.hpp>
|
||||
#include <boost/container/detail/addressof.hpp>
|
||||
|
||||
@@ -187,9 +187,8 @@ class node_allocator_base
|
||||
template < typename U, class ...Args>
|
||||
inline void construct(U* p, Args&& ...args)
|
||||
{
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;
|
||||
boost::container::dtl::dispatch_uses_allocator
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p, ::boost::forward<Args>(args)...);
|
||||
boost::container::uninitialized_construct_using_allocator
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()), ::boost::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
#else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
||||
@@ -198,9 +197,8 @@ class node_allocator_base
|
||||
template < typename U BOOST_MOVE_I##N BOOST_MOVE_CLASSQ##N >\
|
||||
void construct(U* p BOOST_MOVE_I##N BOOST_MOVE_UREFQ##N)\
|
||||
{\
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;\
|
||||
boost::container::dtl::dispatch_uses_allocator\
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
boost::container::uninitialized_construct_using_allocator\
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()) BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
}\
|
||||
//
|
||||
BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_ALLOCATORS_NODE_ALLOCATOR_CONSTRUCT_CODE)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <boost/interprocess/exceptions.hpp>
|
||||
#include <boost/interprocess/detail/utilities.hpp>
|
||||
|
||||
#include <boost/container/detail/dispatch_uses_allocator.hpp>
|
||||
#include <boost/container/uses_allocator_construction.hpp>
|
||||
|
||||
#include <boost/move/adl_move_swap.hpp>
|
||||
#include <cstddef>
|
||||
@@ -192,9 +192,8 @@ class private_adaptive_pool_base
|
||||
template < typename U, class ...Args>
|
||||
inline void construct(U* p, Args&& ...args)
|
||||
{
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;
|
||||
boost::container::dtl::dispatch_uses_allocator
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p, ::boost::forward<Args>(args)...);
|
||||
boost::container::uninitialized_construct_using_allocator
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()), ::boost::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
#else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
||||
@@ -203,9 +202,8 @@ class private_adaptive_pool_base
|
||||
template < typename U BOOST_MOVE_I##N BOOST_MOVE_CLASSQ##N >\
|
||||
void construct(U* p BOOST_MOVE_I##N BOOST_MOVE_UREFQ##N)\
|
||||
{\
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;\
|
||||
boost::container::dtl::dispatch_uses_allocator\
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
boost::container::uninitialized_construct_using_allocator\
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()) BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
}\
|
||||
//
|
||||
BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_ALLOCATORS_PRIVATE_ADAPTIVE_POOL_CONSTRUCT_CODE)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <boost/interprocess/exceptions.hpp>
|
||||
#include <boost/interprocess/detail/utilities.hpp>
|
||||
|
||||
#include <boost/container/detail/dispatch_uses_allocator.hpp>
|
||||
#include <boost/container/uses_allocator_construction.hpp>
|
||||
|
||||
#include <boost/move/adl_move_swap.hpp>
|
||||
#include <cstddef>
|
||||
@@ -182,9 +182,8 @@ class private_node_allocator_base
|
||||
template < typename U, class ...Args>
|
||||
inline void construct(U* p, Args&& ...args)
|
||||
{
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;
|
||||
boost::container::dtl::dispatch_uses_allocator
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p, ::boost::forward<Args>(args)...);
|
||||
boost::container::uninitialized_construct_using_allocator
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()), ::boost::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
#else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
||||
@@ -193,9 +192,8 @@ class private_node_allocator_base
|
||||
template < typename U BOOST_MOVE_I##N BOOST_MOVE_CLASSQ##N >\
|
||||
void construct(U* p BOOST_MOVE_I##N BOOST_MOVE_UREFQ##N)\
|
||||
{\
|
||||
boost::container::dtl::allocator_traits_dummy<U> atd;\
|
||||
boost::container::dtl::dispatch_uses_allocator\
|
||||
(atd, uses_segment_manager_t(this->get_segment_manager()), p BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
boost::container::uninitialized_construct_using_allocator\
|
||||
(p, uses_segment_manager_t(this->get_segment_manager()) BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
|
||||
}\
|
||||
//
|
||||
BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_ALLOCATORS_PRIVATE_NODE_ALLOCATOR_CONSTRUCT_CODE)
|
||||
|
||||
@@ -182,10 +182,9 @@ struct CtorArg##N\
|
||||
BOOST_INTERPROCESS_TRY{\
|
||||
T* memory = static_cast<T*>(mem);\
|
||||
for (constructed = 0; constructed < num; ++constructed) {\
|
||||
boost::container::dtl::allocator_traits_dummy<T> atd;\
|
||||
typedef uses_segment_manager<SegmentManager> uses_segment_manager_t;\
|
||||
boost::container::dtl::dispatch_uses_allocator\
|
||||
(atd, uses_segment_manager_t(segment_manager), memory++ BOOST_MOVE_I##N BOOST_MOVE_MFWD##N);\
|
||||
boost::container::uninitialized_construct_using_allocator\
|
||||
(memory++, uses_segment_manager_t(segment_manager) BOOST_MOVE_I##N BOOST_MOVE_MFWD##N);\
|
||||
}\
|
||||
}\
|
||||
BOOST_INTERPROCESS_CATCH(...) {\
|
||||
@@ -224,10 +223,9 @@ struct CtorIt##N\
|
||||
BOOST_INTERPROCESS_TRY{\
|
||||
T* memory = static_cast<T*>(mem);\
|
||||
for(constructed = 0; constructed < num; ++constructed){\
|
||||
boost::container::dtl::allocator_traits_dummy<T> atd;\
|
||||
typedef uses_segment_manager<SegmentManager> uses_segment_manager_t;\
|
||||
boost::container::dtl::dispatch_uses_allocator\
|
||||
(atd, uses_segment_manager_t(segment_manager), memory++ BOOST_MOVE_I##N BOOST_MOVE_MITFWD##N);\
|
||||
boost::container::uninitialized_construct_using_allocator\
|
||||
(memory++, uses_segment_manager_t(segment_manager) BOOST_MOVE_I##N BOOST_MOVE_MITFWD##N);\
|
||||
++(*this);\
|
||||
}\
|
||||
}\
|
||||
|
||||
Reference in New Issue
Block a user