loopprep

Memory Allocator

total 00:00
Hard48 minPremium Asked at OpenAI

    Hand out blocks of one contiguous region the way malloc does: first fit, free with coalescing, realloc that grows in place when it can, best fit to fight fragmentation, compaction, and a free-space index that stays fast with thousands of holes.

    The five steps
    1. malloc and free 8 min
    2. realloc and free space 9 min
    3. Best fit 10 min
    4. Compaction 10 min
    5. Thousands of holes 11 min