mtrebi / memory-allocators

Custom memory allocators in C++ to improve the performance of dynamic memory allocation
MIT License
1.75k stars 160 forks source link

StackAllocator is not performant and wastes memory on padding #25

Open inovachrono opened 2 years ago

inovachrono commented 2 years ago

I assume that the project has been abandoned since a some pull requests are pending.

Anyways, I will address a few things here for those coming to this repository in search of knowledge from this code base.

Problems with using "AllocationHeader"

A better way of implementing is to use push/begin constructs that would store the offset of stack and pop/end which would reinstate the stack allocator back to the pushed offset.