Commit Graph

3 Commits

Author SHA1 Message Date
Aryadev Chavali
9427c3d324 Implement arena_reset 2024-11-01 08:15:46 +00:00
Aryadev Chavali
cf93eede6b region_delete->region_delete_rec and slightly rework arena_realloc
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-01 08:13:11 +00:00
Aryadev Chavali
46f62c5d2c Simple arena implementation using singly linked list
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-11-01 07:48:19 +00:00