Closed
Description
Right now it's not possible to construct MapFlags
for huge page mapping with huge page size variable at runtime without constructing a big intermediate enum or by using from_bits
and libc::MAP_HUGE_SHIFT
.
It would be nice to have something like this:
impl MapFlags {
fn map_hugetlb_with_shift(shift: u8) -> Option<Self> {
if shift >= 16 && shift <= 63 {
Some(Self(libc::MAP_HUGETLB | (shift as i32) << libc::MAP_HUGE_SHIFT))
} else {
None
}
}
}
Metadata
Metadata
Assignees
Labels
No labels