Bumpalo allows for extremely fast dynamic allocations by simply bumping a pointer forward. This is known as a Bump Allocator, hence the name Bumpalo. Jon Blow demonstrated that this is extremely great for cyclical code, such as each frame of a game. You simply bump allocate your memory forward during a frame and then for the next frame you simply reset the pointer back to the beginning. So even deallocation is immediate / O(1). I'm pretty sure Jon Blow even made this an integral part of JAI.
We may want to use this as well for our rendering code. All the temporary allocations we do in there could simply be bumped forward.
https://github.com/fitzgen/bumpalo
Bumpalo allows for extremely fast dynamic allocations by simply bumping a pointer forward. This is known as a Bump Allocator, hence the name Bumpalo. Jon Blow demonstrated that this is extremely great for cyclical code, such as each frame of a game. You simply bump allocate your memory forward during a frame and then for the next frame you simply reset the pointer back to the beginning. So even deallocation is immediate / O(1). I'm pretty sure Jon Blow even made this an integral part of JAI.
We may want to use this as well for our rendering code. All the temporary allocations we do in there could simply be bumped forward.
https://github.com/fitzgen/bumpalo