#[repr(i32)]pub enum Advice {
Normal = 0,
Random = 1,
Sequential = 2,
WillNeed = 3,
ZeroWiredPages = 6,
}
Expand description
Values supported by Mmap::advise
and MmapMut::advise
functions.
See madvise() map page.
Variants§
Normal = 0
MADV_NORMAL
No special treatment. This is the default.
Random = 1
MADV_RANDOM
Expect page references in random order. (Hence, read ahead may be less useful than normally.)
Sequential = 2
MADV_SEQUENTIAL
Expect page references in sequential order. (Hence, pages in the given range can be aggressively read ahead, and may be freed soon after they are accessed.)
WillNeed = 3
MADV_WILLNEED
Expect access in the near future. (Hence, it might be a good idea to read some pages ahead.)
ZeroWiredPages = 6
MADV_ZERO_WIRED_PAGES - Darwin only
Indicates that the application would like the wired pages in this address range to be zeroed out if the address range is deallocated without first unwiring the pages (i.e. a munmap(2) without a preceding munlock(2) or the application quits). This is used with madvise() system call.