-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Sven Bieg edited this page Jun 10, 2023
·
34 revisions
The usual heap-manager simply connects free blocks to a chain.
If there are many gaps, finding a free block can take many iterations.
My manager uses Clusters to map gaps by size and by offset.
When allocating, the smallest free block top most of the heap is returned.
The difficulty was to make the map reentrant.
Adding a free block to the map can cause an allocation, the opposite when removing.
I got this done by caching releases in free blocks, and
making allocations passive without moving anything in the map.
Copyright 2024, Sven Bieg (svenbieg@web.de)