Skip to main content

nonresident

Function nonresident 

Source
pub(crate) fn nonresident(ptr: *mut u8, len: usize) -> bool
Available on Unix and crate feature pool only.
Expand description

Whether every page of the page-aligned subrange of [ptr, ptr + len) has been unmapped from this process, per the pagemap present bits: the observation the pageout ledger trusts instead of the reclaim advice’s return value. A page unmapped to a swap entry counts as reclaimed even while its clean copy lingers in the kernel’s swap cache. Errs toward false (resident) when the observation is unavailable. In test builds the answer comes from the fake_residency seam instead of the platform.