Four ways to choose a free chunk, and two allocators built for speed, following the Free-Space Management chapter of OSTEP. Each scenario plays step by step, and you can type your own sequence of requests.
100 bytes. A, B and C belong to other code. Headers are ignored to keep the numbers simple.
Kept in address order. Each chunk is written as size@address.
The search the allocator runs.
6 pages of 4KB. Caches take whole pages from here and give them back when they are empty.
1KB objects, 4 per slab.
512B objects, 8 per slab.
Allocation never searches or splits: it takes a ready object from a slab.
A 64KB pool. Each row halves the block size, and only blocks that exist are drawn.
One list per block size, holding block addresses in KB.
Buddies differ in exactly one address bit, so finding one is a single XOR.
Keyboard: ← → to step, Space to play or pause.