r/cprogramming • u/DreadSpidey • Sep 14 '26
No idea if my arena allocator works 😭
I built a small arena allocator in C called PhaseAlloc. The problem is i have no idea if it works on other computers/platforms other than my own 😭
It's now at v1.1.0, with tests, benchmarks, dynamic growth, alignment, and memory stats.
I'd appreciate any feedback or criticism from people who know C/systems programming.
Its downloadable here, so pls help me out 🙏:
0
Upvotes
2
u/nukestar101 Sep 14 '26
Did not dive deep but what's the use of 'phasealloc_internal.h' ? Why can't the content of this header be in 'phasealloc.c' ? Phase chunk is private and has no business exposing it to public.
Make use of static for the functions not exposed to public
8
u/zhivago Sep 14 '26
parse_true has an error.
What does
do if *input holds "truely"?
1
u/lehmagavan Sep 14 '26
How much faster is your arena compared to malloc? Im curious cause Im building my own arena implementation at the moment