34 Comments
⭠ Return to thread

Thanks for the article! Very inspiring.

I wonder what you think about pathological cases with the pool allocator, where memory gets tied up in the free list of one struct and becomes unavailable for other allocations.

For example, let's say that, through user error, the level editor for a game allocates and frees 200k entities (the user selected the entire level and copied it 100 times by accident, then pressed undo). Now a potentially large amount of memory gets leaked into the entity free list (and other associated free lists).

Perhaps this is a reason to use a malloc-style allocator, where freeing memory makes it available for other kinds of allocations?

Expand full comment