Hacker News new | ask | show | jobs
by jimbo_joe 1165 days ago
Stack is usually faster to use since it's always sequential in nature which is related to why it's considered finite while heap can theoretically take all of OS' available memory. This way the user doesn't have to consider maximum stack depth prior to running the app
1 comments

> Stack is usually faster to use since it's always sequential in nature

You can use an arena allocator to get linear allocation on the heap too. Arena allocation is underused IMHO.