Apex › Systems & OS

Buddy allocator

How the Linux kernel's page allocator hands out and reclaims memory: every block is a power of two, a request rounds up and splits a larger free block in half until it fits, and freeing a block instantly coalesces with its "buddy" (at offset XOR size) back into a larger block. Allocate and free, and watch splitting, coalescing, and fragmentation happen live.

More in Systems & OS