Expand description
The heap: per-bin page queues, the small-size direct table, the generic
(heartbeat) allocation path, and free (mirrors heap.c + the hot parts of
alloc.c/page.c). Since M4 there is NO global lock: every thread owns its
own heap, free routes by the segment’s owner id, and cross-thread frees go
through the loom-modeled 4-state protocol in page.rs.
Structs§
- Area
Info - Area descriptor handed to block visitors (mirrors
mi_heap_area_t). - Heap
- The heap.
- Page
Queue - A doubly-linked queue of pages serving one bin.
- Stats
- Always-on counters (plan §7.5 instrument #2): the primary evidence for sub-1% bricks and the work-parity check for every A/B.
Constants§
- MAX_
DIRECT_ BIN - Largest bin whose block size still fits the
direct[]fast-path table. - MAX_
NORMAL_ BIN - Largest bin index actually reachable from a size (rest are M3 large pages).
Functions§
- visit_
segment_ ⚠blocks - Visit every live page of ONE segment; optionally each allocated block.
tag_filter >= 0skips pages with a different heap tag.ownerselects exact snapshots (collect) vs read-only walks (abandoned segments).