Skip to content
Discussion options

You must be logged in to vote

Yeah, this is a custom memory allocator. It is a memory arena allocator.
I plan on using this instead of calling malloc and free. A memory arena manages large chunks of memory, called blocks, and it hands out smaller mem allocations from these blocks.

Instead of calling free() to free memory, freeing is done by resetting the arena or using temporary scopes.

There are 3 core components to this allocator:

  1. memory_arena: this tracks the current block of memory.
  2. platform_memory_block: this represents a block of raw memory. New memory blocks are requested from the platform system (this is implemented in the platform layer.
  3. temporary_memory: this is used for scoped allocations which makes it ea…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by btgvesta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants