Expand description

Slab allocation.

A slab allocator divides the managed region into a fixed number of equally-sized blocks. This design is ideal for allocating many values of a single type, and a combination of slab sizes can be useful in constructing more general-purpose allocators.

Characteristics

Time complexity
OperationBest-caseWorst-case
AllocateO(1)O(1)
DeallocateO(1)O(1)
Fragmentation

Due to slab allocators’ fixed-size allocations, they exhibit no external fragmentation. The degree of internal fragmentation is dependent on the difference between the average allocation size and the allocator’s block size.

Structs

A slab allocator.