#include <region.h>
Public Types | |
typedef T | value_type |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef T & | reference |
typedef const T & | const_reference |
typedef std::size_t | size_type |
typedef std::ptrdiff_t | difference_type |
typedef mem_region | pool_type |
Public Member Functions | |
pointer | address (reference value) const |
Return address of values. | |
const_pointer | address (const_reference value) const |
region_alloc () throw () | |
Default constructor creates a new pool. | |
region_alloc (const region_alloc &src) throw () | |
Copy constructor addrefs the region. | |
template<class U> | |
region_alloc (const region_alloc< U > &src) throw () | |
Copy constructor addrefs the region. | |
~region_alloc () throw () | |
Destructor decrefs the region. | |
size_type | max_size () const throw () |
Return maximum number of elements that can be allocated. | |
pointer | allocate (size_type num, const void *=0) |
Allocate (but don't initialize) num elements of type T. | |
void | construct (pointer p, const T &value) |
Initialize elements of allocated storage p with value `value` using placement new. | |
void | destroy (pointer p) |
Destroy elements of initialized storage p by calling their destructor. | |
void | deallocate (pointer p, size_type num) |
Deallocate storage p of deleted elements. | |
Public Attributes | |
pool_type * | region |
Classes | |
struct | rebind |
Rebind allocator to type U. More... |
Useful for restricting locality and/or avoiding multithreaded contention.
Definition at line 103 of file region.h.
commons::region_alloc< T >::region_alloc | ( | const region_alloc< T > & | src | ) | throw () [inline] |
Copy constructor addrefs the region.
TODO: This is in fact highly necessary. Understand why. Understand both the following ctors.
Definition at line 143 of file region.h.
References commons::mem_region::addref().
00143 { 00144 region = src.region; 00145 region->addref(); 00146 }
size_type commons::region_alloc< T >::max_size | ( | ) | const throw () [inline] |
void commons::region_alloc< T >::deallocate | ( | pointer | p, | |
size_type | num | |||
) | [inline] |