summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-04-09Add types.h for useful type aliasesHEADmasterAryadev Chavali
So simple it's not got any functions.
2025-04-09Translate region_delete_rec while loop to for loop, minor editsAryadev Chavali
2025-04-09Fixed arena_reallocAryadev Chavali
So the real purpose of arena_realloc is to figure out if we can get away with just adjusting the region that the pointer given resides in so that we don't need to _actually_ allocate any new memory. The previous implementation did this in the special case where the pointer given _is_ the entire region. But we can adjust the region's size _if_ the pointer given is the last allocation on the region i.e. it's on the tail end.
2024-11-01Completely document arena's functions and make region publicAryadev Chavali
If someone uses the arena functionality, they may as well get the region functionality for free. In particular, they may just want a fixed bump allocator implementation which they can get here for free.
2024-11-01Implement arena_resetAryadev Chavali
2024-11-01region_delete->region_delete_rec and slightly rework arena_reallocAryadev Chavali
1) Better naming. 2) Use MIN macro for choosing the size to copy over from the old buffer to the new one. Also fix issue where we free the old region of memory before copying it over to the new buffer.
2024-11-01Simple arena implementation using singly linked listAryadev Chavali
Manages individual allocations via a bump allocator (region), with unfit allocations triggering a new region allocation that is added to a linked list. Any new region allocations will always be oversized for the initially requested size, to amortize the cost of future allocations.
2024-10-24VEC_MULT may be set as user, so have a #if guard.Aryadev Chavali
2024-10-24Use VEC_MULT in vec_ensure_remainingAryadev Chavali
2024-10-24Clean up macros in vec.hAryadev Chavali
2024-10-01Vector libraryAryadev Chavali