IT lexicon › Programming › Pool allocator

Pool allocator

Programming På svenska → Updated: 2026-10-26

An allocator that divides a buffer into equal blocks linked in a free list and hands them out in any order in constant time.

When a program constantly creates and destroys same-sized objects — bullets, particles, entities — a general-purpose heap is both slow and prone to fragmentation. A pool allocator pre-divides the buffer into fixed-size blocks and threads the free ones onto a simple linked list. Allocating is popping the first free block; freeing is pushing it back on front. Both are O(1).

Because every block is the same size, they can be reused in any order without leaving holes nothing fits into — fragmentation disappears by construction. Don't confuse the mechanism with object pooling, which is the same idea one level up: there you reuse finished game objects, here you reuse raw memory blocks.

← Back to the lexicon