Medial Code Documentation
|
A thread local allocator that get memory from a threadlocal memory pool. This is suitable to allocate objects that do not cross thread. More...
#include <memory.h>
Public Types | |
typedef T * | pointer |
pointer type | |
typedef const T * | const_ptr |
const pointer type | |
typedef T | value_type |
value type | |
Public Member Functions | |
ThreadlocalAllocator () | |
default constructor | |
template<typename U > | |
ThreadlocalAllocator (const ThreadlocalAllocator< U > &other) | |
constructor from another allocator | |
T * | allocate (size_t n) |
allocate memory | |
void | deallocate (T *p, size_t n) |
deallocate memory | |
A thread local allocator that get memory from a threadlocal memory pool. This is suitable to allocate objects that do not cross thread.
T | the type of the data to be allocated. |
|
inline |
constructor from another allocator
other | another allocator |
U | another type |
|
inline |
allocate memory
n | number of blocks |
|
inline |
deallocate memory
p | a memory to be returned. |
n | number of blocks |