pub struct MmapStrategy {
pub huge_page: HugePageSupport,
pub prot: MmapProtection,
pub replace: bool,
pub reserve: bool,
}Expand description
Strategy for performing mmap
Fields§
§huge_page: HugePageSupportWhether we should use huge page for this mmapping. Fallback: for platforms that do not support huge pages, this option can be ignored.
prot: MmapProtectionThe protection flags for mmap.
replace: boolWhether this mmap allows replacing existing mappings. Fallback: for platforms that cannot replace existing mappings, or always replace existing mappings, this option can be ignored.
reserve: boolWhether this mmap allows reserve/commit physical memory. This has to be implemented properly for a platform. Otherwise, we will see huge unrealistic memory consumption.
Implementations§
Source§impl MmapStrategy
impl MmapStrategy
Sourcepub const INTERNAL_MEMORY: Self
pub const INTERNAL_MEMORY: Self
The strategy for MMTk’s own internal memory
Sourcepub fn new(
huge_page: HugePageSupport,
prot: MmapProtection,
replace: bool,
reserve: bool,
) -> Self
pub fn new( huge_page: HugePageSupport, prot: MmapProtection, replace: bool, reserve: bool, ) -> Self
Create a new strategy
Sourcepub fn huge_page(self, huge_page: HugePageSupport) -> Self
pub fn huge_page(self, huge_page: HugePageSupport) -> Self
Set huge page option.
Sourcepub fn transparent_hugepages(self, enable: bool) -> Self
pub fn transparent_hugepages(self, enable: bool) -> Self
Set huge page option by a boolean flag.
Sourcepub fn prot(self, prot: MmapProtection) -> Self
pub fn prot(self, prot: MmapProtection) -> Self
Set protection option.
Source§impl MmapStrategy
impl MmapStrategy
Sourcepub fn get_posix_mmap_flags(&self) -> i32
pub fn get_posix_mmap_flags(&self) -> i32
get the flags for POSIX mmap.
Trait Implementations§
Source§impl Clone for MmapStrategy
impl Clone for MmapStrategy
Source§fn clone(&self) -> MmapStrategy
fn clone(&self) -> MmapStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MmapStrategy
impl Debug for MmapStrategy
Source§impl Default for MmapStrategy
impl Default for MmapStrategy
impl Copy for MmapStrategy
Auto Trait Implementations§
impl Freeze for MmapStrategy
impl RefUnwindSafe for MmapStrategy
impl Send for MmapStrategy
impl Sync for MmapStrategy
impl Unpin for MmapStrategy
impl UnwindSafe for MmapStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more