Expand description
OS memory layer over crate::prim (mirrors upstream src/os.c).
Adds to prim: cached configuration, page-size rounding, alignment
validation, and the purge policy (decommit vs reset — mi_option_purge_decommits,
wired to the options table in M7; until then callers pass the policy).
Structs§
- OsBlock
- A block of OS memory returned by
alloc_aligned.
Functions§
- alloc_
aligned - Reserve (and optionally commit) an aligned block of OS memory.
- alloc_
granularity - Reservation granularity (64 KiB on Windows, page size elsewhere; cached).
- commit⚠
- Commit a page-aligned sub-range of a reserved block. Returns known-zero.
- decommit⚠
- Decommit a page-aligned sub-range. Returns whether recommit is required.
- free⚠
- Release a block from
alloc_aligned. - large_
page_ size - Large-page size, 0 when unavailable (cached).
- page_
align_ up - Round
sizeup to a whole number of OS pages (never 0). - page_
size - OS page size (cached).
- protect⚠
- Toggle no-access protection on a page-aligned range (guard pages).
- purge⚠
- Purge a range per policy:
purge_decommits→ decommit (returns whether recommit is needed); otherwise reset (stays committed, contents undefined).