pub struct MapHugeFlag(/* private fields */);
Expand description
Represents a statically defined MAP_HUGE_*
flag.
Implementations§
Source§impl MapHugeFlag
impl MapHugeFlag
Sourcepub const HUGE_DEFAULT: Self
pub const HUGE_DEFAULT: Self
The kernel’s default huge-page size.
Sourcepub const unsafe fn from_mask_unchecked(flag: c_int) -> Self
pub const unsafe fn from_mask_unchecked(flag: c_int) -> Self
Create from a raw MAP_HUGE_*
flag.
§Safety
The passed flag
must be a valid bitmask representing a MAP_HUGE_*
value only.
Sourcepub const fn calculate(kilobytes: NonZeroUsize) -> Self
pub const fn calculate(kilobytes: NonZeroUsize) -> Self
Calculate a MAP_HUGE_*
flag from a size (in kB).
Sourcepub const fn try_calculate(kilobytes: usize) -> Option<Self>
pub const fn try_calculate(kilobytes: usize) -> Option<Self>
Attempt to calculate MAP_HUGE_*
flag from a size (in kB).
Sourcepub const fn calculate_or_default(kilobytes: usize) -> Self
pub const fn calculate_or_default(kilobytes: usize) -> Self
Attempt to calculate MAP_HUGE_*
, or use HUGE_DEFAULT
on failure.
§Note
If kilobytes
is 0
, or there is a calculation overflow, then HUGE_DEFAULT
is returned.
Sourcepub const fn is_default(&self) -> bool
pub const fn is_default(&self) -> bool
Check if this is the smallest huge-page size the kernel supports.
Trait Implementations§
Source§impl Clone for MapHugeFlag
impl Clone for MapHugeFlag
Source§fn clone(&self) -> MapHugeFlag
fn clone(&self) -> MapHugeFlag
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MapHugeFlag
impl Debug for MapHugeFlag
Source§impl Default for MapHugeFlag
impl Default for MapHugeFlag
Source§impl From<MapHugeFlag> for c_int
impl From<MapHugeFlag> for c_int
Source§fn from(from: MapHugeFlag) -> Self
fn from(from: MapHugeFlag) -> Self
Converts to this type from the input type.
Source§impl Hash for MapHugeFlag
impl Hash for MapHugeFlag
Source§impl Ord for MapHugeFlag
impl Ord for MapHugeFlag
Source§fn cmp(&self, other: &MapHugeFlag) -> Ordering
fn cmp(&self, other: &MapHugeFlag) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for MapHugeFlag
impl PartialEq for MapHugeFlag
Source§impl PartialOrd for MapHugeFlag
impl PartialOrd for MapHugeFlag
Source§impl TryFrom<HugePage> for MapHugeFlag
impl TryFrom<HugePage> for MapHugeFlag
impl Copy for MapHugeFlag
impl Eq for MapHugeFlag
impl StructuralPartialEq for MapHugeFlag
Auto Trait Implementations§
impl Freeze for MapHugeFlag
impl RefUnwindSafe for MapHugeFlag
impl Send for MapHugeFlag
impl Sync for MapHugeFlag
impl Unpin for MapHugeFlag
impl UnwindSafe for MapHugeFlag
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more