Tier 1: Small Blocks
≤ 128 bytes • Ultra-fast free lists • O(1) operations
32 bytes
Class 0
Small block class 0, allocated from chunk memory with free list reuse
64 bytes
Class 1
Small block class 1, allocated from chunk memory with free list reuse
96 bytes
Class 2
Small block class 2, allocated from chunk memory with free list reuse
128 bytes
Class 3
Small block class 3, allocated from chunk memory with free list reuse
Characteristics: 3-4 CPU cycles, 100K initial capacity, unified headers, cache-aligned
Tier 2: Medium Blocks
129 bytes - 64KB • Nine size classes • High reuse efficiency
256B
Class 0
Medium block class 0, 256 bytes, allocated from chunk memory
512B
Class 1
Medium block class 1, 512 bytes, allocated from chunk memory
1KB
Class 2
Medium block class 2, 1 kilobyte, allocated from chunk memory
2KB
Class 3
Medium block class 3, 2 kilobytes, allocated from chunk memory
4KB
Class 4
Medium block class 4, 4 kilobytes, allocated from chunk memory
8KB
Class 5
Medium block class 5, 8 kilobytes, allocated from chunk memory
16KB
Class 6
Medium block class 6, 16 kilobytes, allocated from chunk memory
32KB
Class 7
Medium block class 7, 32 kilobytes, allocated from chunk memory
64KB
Class 8
Medium block class 8, 64 kilobytes, allocated from chunk memory
Characteristics: 4-6 CPU cycles, 1K initial capacity, same unified header structure
Tier 3: Large Blocks
> 64KB • Dual allocation strategy • Pool + Direct OS
Large Pool
32MB Pre-allocated
✓ Fast allocation
✓ Minimal system calls
× Cannot free individually
Large blocks allocated from 32MB pre-allocated pool, fast allocation with minimal system calls, cannot be individually freed
Direct OS
Individual Allocation
✓ Can free individually
✓ Returns to OS
× Higher overhead
Large blocks allocated directly from OS, can be individually freed back to OS, higher overhead but memory immediately available for reuse
Decision Logic: Pool allocation preferred when space available, falls back to direct OS allocation