FixedPoolAllocator class
Base classes
- class ICoreAllocator
- ICoreAllocator is the base level abstract interface for allocating and deallocating memory.
Constructors, destructors, conversion operators
-
FixedPoolAllocator(ICoreAllocator* pAllocator,
int arg_4,
size_
t objectSize) - ~FixedPoolAllocator() virtual
Public functions
Protected variables
Function documentation
void* FixedPoolAllocator:: Alloc(size_ t size,
const char* name,
unsigned int flags) override
Parameters | |
---|---|
size | size of the requested block. |
name | name of the block (normally used for debugging purposes) |
flags | additional information on how to allocate the block (MEM_PERM or MEM_TEMP) |
Returns | A pointer to the allocated block if successful. NULL if the block could not be allocated. |
void* FixedPoolAllocator:: Alloc(size_ t size,
const char* name,
unsigned int flags,
unsigned int align,
unsigned int alignOffset = 0) override
Parameters | |
---|---|
size | size of the requested block. |
name | name of the block (normally used for debugging purposes) |
flags | additional information on how to allocate the block (MEM_PERM or MEM_TEMP) |
align | some power-of-2 boundary the block must be allocated on. address returned is guaranteed to be aligned to the requested boundary. |
alignOffset | a "header" amount which is subtracted from the power-of-2 alignment. A location inside a memory block will be aligned to this boundary. |
Returns | A pointer to the allocated block if successful. NULL if the block could not be allocated. |
void FixedPoolAllocator:: Free(void* block,
size_ t size = 0) override
Parameters | |
---|---|
block | pointer to the block to be freed. |
size | optional. It may be used to find the pool that the block belongs to. The implementation is free to ignore this and the caller cannot assume that the implementation will do anything with it. |