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

auto Alloc(size_t size, const char* name, unsigned int flags) -> void* override
auto Alloc(size_t size, const char* name, unsigned int flags, unsigned int align, unsigned int alignOffset = 0) -> void* override
auto Free(void* block, size_t size = 0) -> void override

Protected variables

ICoreAllocator* mpAllocator
int field_8
int field_C
int field_10
size_t mnObjectSize
int field_18
int field_1C

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.