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

First Fit Combines Two Conditions

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.

2 / 6

Search Does Not Claim

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.

3 / 6

Append Preserves Reachability

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.

4 / 6

Aggregate Capacity Is Not One Fit

A(24 free), B(80 used), C(48 free), D(32 free):

  • Free count=3.
  • Free payload capacity=104.
  • No individual block can hold 100 bytes.

Logical neighbors are not automatically physically adjacent.

5 / 6

Trace Before Implementing

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.

6 / 6
←/→ or click edges to navigate · ? help · N notes · F fullscreen