Enum mmtk::plan::AllocationSemantics
source · #[repr(i32)]pub enum AllocationSemantics {
Default = 0,
Immortal = 1,
Los = 2,
Code = 3,
ReadOnly = 4,
LargeCode = 5,
NonMoving = 6,
}
Expand description
Allocation semantics that MMTk provides. Each allocation request requires a desired semantic for the object to allocate.
Variants§
Default = 0
The default semantic. This means there is no specific requirement for the allocation. The actual semantic of the default will depend on the GC plan in use.
Immortal = 1
Immortal objects will not be reclaimed. MMTk still traces immortal objects, but will not reclaim the objects even if they are dead.
Los = 2
Large objects. It is usually desirable to allocate large objects specially. Large objects
are allocated with page granularity and will not be moved.
Each plan provides max_non_los_default_alloc_bytes
(see crate::plan::PlanConstraints
),
which defines a threshold for objects that can be allocated with the default semantic. Any object that is larger than the
threshold must be allocated with the Los
semantic.
This semantic may get removed and MMTk will transparently allocate into large object space for large objects.
Code = 3
Code objects have execution permission. Note that this is a place holder for now. Currently all the memory MMTk allocates has execution permission.
ReadOnly = 4
Read-only objects cannot be mutated once it is initialized. Note that this is a place holder for now. It does not provide read only semantic.
LargeCode = 5
Los + Code.
NonMoving = 6
Non moving objects will not be moved by GC.
Trait Implementations§
source§impl Clone for AllocationSemantics
impl Clone for AllocationSemantics
source§fn clone(&self) -> AllocationSemantics
fn clone(&self) -> AllocationSemantics
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AllocationSemantics
impl Debug for AllocationSemantics
source§impl Enum for AllocationSemantics
impl Enum for AllocationSemantics
source§impl<V> EnumArray<V> for AllocationSemantics
impl<V> EnumArray<V> for AllocationSemantics
source§impl PartialEq for AllocationSemantics
impl PartialEq for AllocationSemantics
source§fn eq(&self, other: &AllocationSemantics) -> bool
fn eq(&self, other: &AllocationSemantics) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for AllocationSemantics
impl Eq for AllocationSemantics
impl StructuralPartialEq for AllocationSemantics
Auto Trait Implementations§
impl RefUnwindSafe for AllocationSemantics
impl Send for AllocationSemantics
impl Sync for AllocationSemantics
impl Unpin for AllocationSemantics
impl UnwindSafe for AllocationSemantics
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
§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>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<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>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
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)
&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)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§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>
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>
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