#include <fixed_pool.h>
Public Member Functions | |
fixed_pool (void *pMemory=NULL) | |
fixed_pool (void *pMemory, size_t memorySize, size_t nodeSize, size_t alignment, size_t alignmentOffset=0) | |
fixed_pool & | operator= (const fixed_pool &) |
void * | allocate () |
void * | allocate (size_t, size_t) |
void | deallocate (void *p) |
const char * | get_name () const |
void | set_name (const char *) |
bool | can_allocate () const |
![]() | |
fixed_pool_base (void *pMemory=NULL) | |
fixed_pool_base & | operator= (const fixed_pool_base &) |
EASTL_API void | init (void *pMemory, size_t memorySize, size_t nodeSize, size_t alignment, size_t alignmentOffset=0) |
size_t | peak_size () const |
bool | can_allocate () const |
Additional Inherited Members | |
![]() | |
Link * | mpHead |
Link * | mpNext |
Link * | mpCapacity |
size_t | mnNodeSize |
Implements a simple fixed pool allocator for use by fixed-size containers. This is not a generic eastl allocator which can be plugged into an arbitrary eastl container, as it simplifies some functions are arguments for the purpose of efficiency.
|
inline |
Default constructor. User usually will want to call init() after
constructing via this constructor. The pMemory argument is for the purposes of temporarily storing a pointer to the buffer to be used. Even though init may have a pMemory argument, this arg is useful for temporary storage, as per copy construction.
|
inline |
Constructs a fixed_pool with a given set of parameters.
|
inline |
allocate
Allocates a new object of the size specified upon class initialization. Returns NULL if there is no more memory.
|
inline |
can_allocate
Returns true if there are any free links.
|
inline |
deallocate
Frees the given object which was allocated by allocate(). If the given node was not allocated by allocate() then the behaviour is undefined.
|
inline |
fixed_pool operator=