diff options
Diffstat (limited to 'boost/interprocess/allocators/adaptive_pool.hpp')
-rw-r--r-- | boost/interprocess/allocators/adaptive_pool.hpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/boost/interprocess/allocators/adaptive_pool.hpp b/boost/interprocess/allocators/adaptive_pool.hpp index 846df5d413..a85202b4ee 100644 --- a/boost/interprocess/allocators/adaptive_pool.hpp +++ b/boost/interprocess/allocators/adaptive_pool.hpp @@ -35,7 +35,7 @@ #include <cstddef> //!\file -//!Describes adaptive_pool pooled shared memory STL compatible allocator +//!Describes adaptive_pool pooled shared memory STL compatible allocator namespace boost { namespace interprocess { @@ -101,11 +101,11 @@ class adaptive_pool_base typedef boost::container::container_detail::transform_multiallocation_chain <typename SegmentManager::multiallocation_chain, T>multiallocation_chain; - //!Obtains adaptive_pool_base from + //!Obtains adaptive_pool_base from //!adaptive_pool_base template<class T2> struct rebind - { + { typedef adaptive_pool_base<Version, T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other; }; @@ -122,15 +122,15 @@ class adaptive_pool_base //!Constructor from a segment manager. If not present, constructs a node //!pool. Increments the reference count of the associated node pool. //!Can throw boost::interprocess::bad_alloc - adaptive_pool_base(segment_manager *segment_mngr) + adaptive_pool_base(segment_manager *segment_mngr) : mp_node_pool(ipcdetail::get_or_create_node_pool<typename node_pool<0>::type>(segment_mngr)) { } - //!Copy constructor from other adaptive_pool_base. Increments the reference + //!Copy constructor from other adaptive_pool_base. Increments the reference //!count of the associated node pool. Never throws - adaptive_pool_base(const adaptive_pool_base &other) - : mp_node_pool(other.get_node_pool()) - { - node_pool<0>::get(ipcdetail::to_raw_pointer(mp_node_pool))->inc_ref_count(); + adaptive_pool_base(const adaptive_pool_base &other) + : mp_node_pool(other.get_node_pool()) + { + node_pool<0>::get(ipcdetail::to_raw_pointer(mp_node_pool))->inc_ref_count(); } //!Assignment from other adaptive_pool_base @@ -151,7 +151,7 @@ class adaptive_pool_base //!Destructor, removes node_pool_t from memory //!if its reference count reaches to zero. Never throws - ~adaptive_pool_base() + ~adaptive_pool_base() { ipcdetail::destroy_node_pool_if_last_link(node_pool<0>::get(ipcdetail::to_raw_pointer(mp_node_pool))); } //!Returns a pointer to the node pool. @@ -178,14 +178,14 @@ class adaptive_pool_base //!Equality test for same type //!of adaptive_pool_base template<unsigned int V, class T, class S, std::size_t NPC, std::size_t F, unsigned char OP> inline -bool operator==(const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc1, +bool operator==(const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc1, const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc2) { return alloc1.get_node_pool() == alloc2.get_node_pool(); } //!Inequality test for same type //!of adaptive_pool_base template<unsigned int V, class T, class S, std::size_t NPC, std::size_t F, unsigned char OP> inline -bool operator!=(const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc1, +bool operator!=(const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc1, const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc2) { return alloc1.get_node_pool() != alloc2.get_node_pool(); } @@ -211,11 +211,11 @@ class adaptive_pool_v1 template<class T2> struct rebind - { + { typedef adaptive_pool_v1<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other; }; - adaptive_pool_v1(SegmentManager *segment_mngr) + adaptive_pool_v1(SegmentManager *segment_mngr) : base_t(segment_mngr) {} @@ -230,13 +230,13 @@ class adaptive_pool_v1 /// @endcond -//!An STL node allocator that uses a segment manager as memory +//!An STL node allocator that uses a segment manager as memory //!source. The internal pointer type will of the same type (raw, smart) as //!"typename SegmentManager::void_pointer" type. This allows //!placing the allocator in shared memory, memory mapped-files, etc... //! -//!This node allocator shares a segregated storage between all instances -//!of adaptive_pool with equal sizeof(T) placed in the same segment +//!This node allocator shares a segregated storage between all instances +//!of adaptive_pool with equal sizeof(T) placed in the same segment //!group. NodesPerBlock is the number of nodes allocated at once when the allocator //!needs runs out of nodes. MaxFreeBlocks is the maximum number of totally free blocks //!that the adaptive node pool will hold. The rest of the totally free blocks will be @@ -271,11 +271,11 @@ class adaptive_pool template<class T2> struct rebind - { + { typedef adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other; }; - adaptive_pool(SegmentManager *segment_mngr) + adaptive_pool(SegmentManager *segment_mngr) : base_t(segment_mngr) {} @@ -299,11 +299,11 @@ class adaptive_pool typedef typename segment_manager::size_type size_type; typedef typename segment_manager::difference_type difference_type; - //!Obtains adaptive_pool from + //!Obtains adaptive_pool from //!adaptive_pool template<class T2> struct rebind - { + { typedef adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other; }; @@ -314,7 +314,7 @@ class adaptive_pool adaptive_pool& operator= (const adaptive_pool<T2, SegmentManager2, N2, F2, OP2>&); - //!Not assignable from + //!Not assignable from //!other adaptive_pool //adaptive_pool& operator=(const adaptive_pool&); @@ -324,7 +324,7 @@ class adaptive_pool //!Can throw boost::interprocess::bad_alloc adaptive_pool(segment_manager *segment_mngr); - //!Copy constructor from other adaptive_pool. Increments the reference + //!Copy constructor from other adaptive_pool. Increments the reference //!count of the associated node pool. Never throws adaptive_pool(const adaptive_pool &other); @@ -351,7 +351,7 @@ class adaptive_pool //!Never throws size_type max_size() const; - //!Allocate memory for an array of count elements. + //!Allocate memory for an array of count elements. //!Throws boost::interprocess::bad_alloc if there is no enough memory pointer allocate(size_type count, cvoid_pointer hint = 0); @@ -375,7 +375,7 @@ class adaptive_pool //!Never throws const_pointer address(const_reference value) const; /* - //!Copy construct an object. + //!Copy construct an object. //!Throws if T's copy constructor throws void construct(const pointer &ptr, const_reference v); @@ -390,7 +390,7 @@ class adaptive_pool std::pair<pointer, bool> allocation_command(boost::interprocess::allocation_type command, - size_type limit_size, + size_type limit_size, size_type preferred_size, size_type &received_size, const pointer &reuse = 0); @@ -448,13 +448,13 @@ class adaptive_pool //!Equality test for same type //!of adaptive_pool template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline -bool operator==(const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1, +bool operator==(const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1, const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2); //!Inequality test for same type //!of adaptive_pool template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline -bool operator!=(const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1, +bool operator!=(const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1, const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2); #endif |