class FrameAllocator::MemoryBlock

A single block of memory within a frame allocator.

Public

Constructors

MemoryBlock

MemoryBlock(u32 size)

Methods

~MemoryBlock

~MemoryBlock() = default

Alloc

u8 *Alloc(u32 allocationSize)

Allocates a piece of memory within the block using bump pointer allocation.

allocationSize
Number of bytes to allocate.

Returns: Pointer to the allocated memory.

Clear

void Clear()

Releases all allocations within a block by resetting the free pointer to zero.

Does not actually free the underlying memory buffer.

Fields

Data

u8 * Data

FreePointer

u32 FreePointer

Size

u32 Size