Skip to main content

SLAB_SIZES

Constant SLAB_SIZES 

Source
const SLAB_SIZES: [usize; 26];
Expand description

Slab block sizes chosen to bound internal fragmentation to ~25% worst-case (average ~12%) instead of 50% with pure power-of-two classes.

The progression follows a roughly 1.25× step above 64 bytes. Below 64 bytes the absolute waste of a 2× jump is small enough (max 32 bytes) to keep power-of-two boundaries, avoiding an explosion of size classes.

Class rangeStepMax waste
8 to 64 Bx2 / 1,5×≤ 32 B
64 to 256 B~1.25×≤ 64 B
256 to 2048 B1.25×≤ 512 B