Sierra Toolkit
Version of the Day
|
#include <fixed_pool_eastl.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 | 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 &) |
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.
Definition at line 260 of file fixed_pool_eastl.h.
|
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.
Definition at line 271 of file fixed_pool_eastl.h.
|
inline |
Constructs a fixed_pool with a given set of parameters.
Definition at line 281 of file fixed_pool_eastl.h.
|
inline |
operator=
Definition at line 290 of file fixed_pool_eastl.h.
|
inline |
allocate
Allocates a new object of the size specified upon class initialization. Returns NULL if there is no more memory.
Definition at line 302 of file fixed_pool_eastl.h.
|
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.
Definition at line 347 of file fixed_pool_eastl.h.
|
inline |
can_allocate
Returns true if there are any free links.
Definition at line 220 of file fixed_pool_eastl.h.