class MemStack

One of the fastest, but also very limiting type of allocator.

All deallocations must happen in opposite order from allocations.

Public

Methods

staticBeginThread

static void BeginThread()

Sets up the stack with the currently active thread.

You need to call this on any thread before doing any allocations or deallocations.

staticEndThread

static void EndThread()

Cleans up the stack for the current thread.

You may not perform any allocations or deallocations after this is called, unless you call beginThread again.

staticAlloc

static u8 *Alloc(u32 amount)

Allocates the given amount of memory on the stack.

amount
The amount to allocate in bytes.

staticDeallocLast

static void DeallocLast(u8 *data)

Deallocates the given memory.

Data must be deallocated in opposite order then when it was allocated.