This List Contains All Tracked Blocks
free_list_head is the historical variable name.
Used nodes remain linked; free flags select reusable nodes.
Preserve an acyclic chain ending at NULL.
1 / 6
free_list_head is the historical variable name.
Used nodes remain linked; free flags select reusable nodes.
Preserve an acyclic chain ending at NULL.
A(24 free) → B(80 used) → C(48 free) → D(32 free).
Request 30 skips A and B, then returns C.
Exact fits qualify; first fit does not search for the smallest fit.
Search 30 twice: C, then C.
After the caller claims C: search 30 returns D.
find_free_block must preserve flags, capacity, links, and head.
A → B → C → NULL; append D.
Set D.next=NULL and C.next=D.
For an empty list, set the head. Never append a node already in the chain.
A(24 free), B(80 used), C(48 free), D(32 free):
Logical neighbors are not automatically physically adjacent.
Empty list → append E(32 used) → append F(32 free).
Search 32 twice, then 33. Draw every link and result.
Implement free-list-operations; growth and ownership changes belong to later callers.