arena
arena copied to clipboard
Arena Allocator implementation in pure C as an stb-style single-file library.
**What?** Added `arena_bytes()` function that counts up how many bytes are allocated in the arena **Why?** I wanted to be able to easily see how much memory was allocated over...
I had some issues lately when I optimize the code with gcc -O2 or any level above 0, It gives me segfault at arena_da_append because of accessing the memory got...
Test program and output. ```sh maria@maria-desktop ~/Work/arena $ gcc -Wall -Wextra test.c && ./a.out 8193 faults (4095.50 bytes/fault) maria@maria-desktop ~/Work/arena $ gcc -Wall -Wextra -DARENA_HUGEPAGES test.c && ./a.out 17 faults...
Hiya, I love this project and would like to have it available in the clib package manager for C. This clib.json file acts like a package.json for those familiar with...
The end of the region should also be inside the grown memory
`arena.h` defines the type `Region` which is a very generic name. This can easily result in naming collisions when `arena.h` is included into a project. This feels especially unnecessary because...
Replaces the anonymous `Arena` struct with a named struct, enabling forward declarations in other headers.
The default capacity of an arena was being set to `ARENA_REGION_DEFAULT_CAPACITY * sizeof(uintptr_t)` on `new_region`, therefore I think it makes sense to divide it on `arena_alloc` so that `ARENA_REGION_DEFAULT_CAPACITY` would...
Adds `arena_memory_usage` function that is useful to get how much memory a specific arena is currently using.
I figured it would be nice to append to a string builder the same way we do to a file with format strings and printf-type functions. Because string builder are...