Skip to main content

Module binned_alloc

Module binned_alloc 

Source
Expand description

Size-class binned allocator for deterministic memory management. Deterministic Binned Free Lists

Provides a size-class allocator with 13 bins (16 B – 64 KB). Each bin maintains a LIFO free list for O(1) alloc/free.

§Determinism guarantees

  • LIFO push/pop: same free+alloc sequence → same addresses.
  • No OS return: pages are never returned to the OS during normal execution. Memory grows monotonically, freed memory is recycled.
  • Deterministic iteration: bins are indexed by size class, not hash-based — iteration order is always the same.

§Size classes

BinSize
016 B
132 B
248 B
364 B
4128 B
5256 B
6512 B
71 KB
82 KB
94 KB
108 KB
1116 KB
1264 KB

Allocations larger than 64 KB go to a dedicated overflow list.

Structs§

BinnedAllocator
Deterministic binned allocator with LIFO free lists.