-
|
Can you explain what is happening in |
Beta Was this translation helpful? Give feedback.
Answered by
bagaffey
Sep 13, 2025
Replies: 1 comment
-
|
Yeah, this is a custom memory allocator. It is a memory arena allocator. 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:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
btgvesta
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
memory_arena: this tracks the current block of memory.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.temporary_memory: this is used for scoped allocations which makes it ea…