Available on Unix and crate feature
pool and non-miri only.Expand description
The platform seam: mapping, unmapping, paging advice, and the page size.
The mmap variant is production; the Miri variant backs regions with the
Rust heap and treats every advice as a contents-preserving no-op — the
weakest behavior the advice contracts allow — so the pool’s tests run
under the interpreter with full provenance and data-race checking:
MIRIFLAGS=-Zmiri-disable-isolation cargo +nightly miri test -p mz-ore --features pool pool::(The isolation flag is for the test harness’s wall-clock log timestamps, not for anything the pool does.)
Enums§
- Advice 🔒
- Paging advice, in the vocabulary the pool needs.
Functions§
- advise 🔒 ⚠
- Applies
adviceto the largest page-aligned subrange of[ptr, ptr + len), rounding the start up and the end down so the advice never spills onto pages the range only partially covers. - map 🔒
- Maps
lenbytes of anonymous memory with the base aligned toalign.lenmust be a whole number of pages andaligna page-multiple power of two. Alignments beyond one page over-map and trim; huge-page alignments additionally adviseMADV_HUGEPAGE(best-effort; the kernel falls back to base pages under fragmentation). - nonresident 🔒
- Whether every page of the page-aligned subrange of
[ptr, ptr + len)has been unmapped from this process, per the present bits in/proc/self/pagemap. A failed observation reportsfalse: the ledger keeps counting pages it cannot prove gone. - page_
size 🔒 - unmap 🔒 ⚠
- Releases a mapping returned by
map.