The Double Headed Stack Allocator

This article explains the technical implementation of a 'bump allocator' or 'stack allocator' for high-performance software development. It details how using a simple integer-based memory management system can optimize performance in resource-constrained environments like video game animation.
Why it matters
Efficient memory management is a foundational skill for systems programming and game development, directly impacting application performance and stability.
When programming high performance applications, such as video games, you learn neat tricks for writing fast code that makes the most of limited resources.
Memory allocation is a huge topic for performance critical code that needs a variable amount of memory.
When you hear “stack allocator” you might think of “alloca” which lets you allocate memory from the actual program stack. That is super useful in a pinch, but that is not what today’s post is about. Another name for the type of stack allocator we are talking about today is “bump allocator”.
Around 2010 I was working at Surreal Software (Midway Seattle) on an open world game “This is Vegas” which unfortunately was cancelled when Midway went out of business.
Get smarter about the news
Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.
Create free accountAlready have an account? Sign in