mxnet
|
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 More... | |
typedef const T * | const_ptr |
const pointer type More... | |
typedef T | value_type |
value type More... | |
Public Member Functions | |
ThreadlocalAllocator () | |
default constructor More... | |
template<typename U > | |
ThreadlocalAllocator (const ThreadlocalAllocator< U > &other) | |
constructor from another allocator More... | |
T * | allocate (size_t n) |
allocate memory More... | |
void | deallocate (T *p, size_t n) |
deallocate memory More... | |
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. |
typedef const T* dmlc::ThreadlocalAllocator< T >::const_ptr |
const pointer type
typedef T* dmlc::ThreadlocalAllocator< T >::pointer |
pointer type
typedef T dmlc::ThreadlocalAllocator< T >::value_type |
value type
|
inline |
default constructor
|
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 |