STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Classes | Public Member Functions | Public Types | Private Attributes | Friends
stapl::pool_allocator< T, N > Class Template Reference

Pool backed allocator. More...

Classes

struct  rebind
 Provides a way to obtain an allocator for a different type. More...
 

Public Member Functions

 pool_allocator (pool_allocator const &)=default
 
template<typename U >
 pool_allocator (pool_allocator< U, N > const &other) noexcept
 
pointer allocate (size_type n, typename pool_allocator< void, N >::const_pointer hint=0)
 
void deallocate (pointer p, size_type n)
 

Public Types

typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef T & reference
 
typedef T const & const_reference
 
typedef T value_type
 

Private Attributes

elements
 STL member.
 

Friends

template<typename , std::size_t >
class pool_allocator
 

Detailed Description

template<typename T, std::size_t N>
class stapl::pool_allocator< T, N >

Pool backed allocator.

Allocator that uses pool allocation for small (<= N bytes) allocations, backed by the runtime::memory_allocator. For larger allocations, it redirects to the standard allocator.

Warning
This allocator may increase your memory consumption, as memory reserved by a pool cannot be used by the rest of the program.
Memory allocated from this allocator can only be freed in the same thread it was allocated from.

The documentation for this class was generated from the following file: