A C++ Standard Library conforming allocator, based on an underlying pool. More...
#include <poolfwd.hpp>
Classes | |
struct | rebind |
Nested class rebind allows for transformation from pool_allocator<T> to pool_allocator<U>. More... | |
Public Types | |
typedef T | value_type |
value_type of template parameter T. More... | |
typedef UserAllocator | user_allocator |
allocator that defines the method that the underlying Pool will use to allocate memory from the system. More... | |
typedef Mutex | mutex |
typedef mutex publishes the value of the template parameter Mutex. More... | |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef pool< UserAllocator > ::size_type | size_type |
typedef pool< UserAllocator > ::difference_type | difference_type |
Public Member Functions | |
BOOST_STATIC_CONSTANT (unsigned, next_size=NextSize) | |
next_size publishes the values of the template parameter NextSize. More... | |
pool_allocator () | |
template<typename U > | |
pool_allocator (const pool_allocator< U, UserAllocator, Mutex, NextSize, MaxSize > &) | |
bool | operator== (const pool_allocator &) const |
bool | operator!= (const pool_allocator &) const |
Static Public Member Functions | |
static pointer | address (reference r) |
static const_pointer | address (const_reference s) |
static size_type | max_size () |
static void | construct (const pointer ptr, const value_type &t) |
static void | destroy (const pointer ptr) |
static pointer | allocate (const size_type n) |
static pointer | allocate (const size_type n, const void *const) |
static void | deallocate (const pointer ptr, const size_type n) |
A C++ Standard Library conforming allocator, based on an underlying pool.
Template parameters for pool_allocator are defined as follows:
T Type of object to allocate/deallocate.
UserAllocator. Defines the method that the underlying Pool will use to allocate memory from the system. See User Allocators for details.
Mutex Allows the user to determine the type of synchronization to be used on the underlying singleton_pool.
NextSize The value of this parameter is passed to the underlying singleton_pool when it is created.
MaxSize Limit on the maximum size used.
typedef const value_type* boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::const_pointer |
typedef const value_type& boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::const_reference |
typedef pool<UserAllocator>::difference_type boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::difference_type |
typedef Mutex boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::mutex |
typedef mutex publishes the value of the template parameter Mutex.
typedef value_type* boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::pointer |
typedef value_type& boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::reference |
typedef pool<UserAllocator>::size_type boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::size_type |
typedef UserAllocator boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::user_allocator |
allocator that defines the method that the underlying Pool will use to allocate memory from the system.
typedef T boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::value_type |
value_type of template parameter T.
|
inline |
Results in default construction of the underlying singleton_pool IFF an instance of this allocator is constructed during global initialization ( required to ensure construction of singleton_pool IFF an instance of this allocator is constructed during global initialization. See ticket #2359 for a complete explanation at http://svn.boost.org/trac/boost/ticket/2359) .
References T.
|
inline |
Results in the default construction of the underlying singleton_pool, this is required to ensure construction of singleton_pool IFF an instance of this allocator is constructed during global initialization. See ticket #2359 for a complete explanation at http://svn.boost.org/trac/boost/ticket/2359 .
References T.
|
inlinestatic |
|
inlinestatic |
References boost::asio::s.
|
inlinestatic |
References boost::n, T, and boost::throw_exception().
Referenced by boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::allocate().
|
inlinestatic |
allocate n bytes
n | bytes to allocate. |
unused. |
References boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::allocate().
boost::pool_allocator< T, UserAllocator, Mutex, NextSize, MaxSize >::BOOST_STATIC_CONSTANT | ( | unsigned | , |
next_size | = NextSize |
||
) |
next_size publishes the values of the template parameter NextSize.
|
inlinestatic |
References boost::python::ptr(), and T.
|
inlinestatic |
Deallocate n bytes from ptr
ptr | location to deallocate from. |
n | number of bytes to deallocate. |
References T.
|
inlinestatic |
References boost::detail::void.
|
inlinestatic |
References boost::accumulators::extract::max.
|
inline |
|
inline |