![]() |
Home | Libraries | People | FAQ | More |
boost::pool_allocator<void, UserAllocator, Mutex, NextSize, MaxSize> — Specialization of pool_allocator<void>.
// In header: <boost/pool/pool_alloc.hpp> template<typename UserAllocator, typename Mutex, unsigned NextSize, unsigned MaxSize> class pool_allocator<void, UserAllocator, Mutex, NextSize, MaxSize> { public: // types typedef void * pointer; typedef const void * const_pointer; typedef void value_type; typedef UserAllocator user_allocator; // allocator that defines the method that the underlying Pool will use to allocate memory from the system. typedef Mutex mutex; // typedef mutex publishes the value of the template parameter Mutex. typedef value_type & reference; typedef const value_type & const_reference; typedef pool< UserAllocator >::size_type size_type; typedef pool< UserAllocator >::difference_type difference_type; // member classes/structs/unions // Nested class rebind allows for transformation from pool_allocator<T> to pool_allocator<underline>. </underline> template<typename U> struct rebind { // types typedef pool_allocator< U, UserAllocator, Mutex, NextSize, MaxSize > other; }; // public member functions pool_allocator(); bool operator==(const pool_allocator &) const; bool operator!=(const pool_allocator &) const; // public static functions static pointer address(reference); static size_type max_size(); static void construct(const pointer, const value_type &); static void destroy(const pointer); static pointer allocate(const size_type); static void deallocate(const pointer, const size_type); // public data members static const unsigned next_size; // next_size publishes the values of the template parameter NextSize. };
Specialization of pool_allocator for type void: required by the standard to make this a conforming allocator type.
pool_allocator public member functionspool_allocator();
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) .
bool operator==(const pool_allocator &) const;
bool operator!=(const pool_allocator &) const;
pool_allocator public static functionsstatic pointer address(reference r);
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 void deallocate(const pointer ptr, const size_type n);
Deallocate n bytes from ptr
Parameters: |
|