r/C_Programming • u/lehmagavan • Sep 15 '26
BD_ARENA
Simple arena implementation I recently built:
https://github.com/andrzejs-gh/bd_arena
- partially macro-based API for convenience
- safe and hazardous allocators
- dynamic growth with a mutable growth factor
Please roast anything you find wrong / missing in it. Thanks a lot, it always helps me grow.
0
Upvotes
âĸ
u/github-guard Sep 15 '26
đ GitHub Guard: Trust Report
â ī¸ This project scored 1/6 â below this subreddit's threshold of 3.
Audit Breakdown:
3
u/LB-- Sep 16 '26
Seems like it's hardcoded to use malloc/free under the hood when growing, that'll put off a lot of people right away. Typically, you'd chain an arena allocator onto whatever allocator comes from a higher level in the app.
1
u/ffd9k Sep 16 '26
bda_alloc fails if the requested size is greater then the block capacity. This is unnecessary because you can just create a new block that is big enough.
0
u/AutoModerator Sep 15 '26
Hi /u/lehmagavan,
Your submission in r/C_Programming was filtered because it links to a git project.
You must edit the submission or respond to this comment with an explanation about how AI was involved in the creation of your project.
While AI-generated code is not disallowed, low-effort "slop" projects may be removed and it's likely that other users push back strongly on substantially AI-generated projects.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
0
u/comfortcube Sep 16 '26 edited Sep 16 '26
Why would one use the hazardous alloc - performance?
I feel like the alloc functions should be able to take specific sizes rather than types, cuz I can always use
sizeof(type).Tiny nitpick but growth factor could probably be
float.