pub enum GcStatus {
Uninitialized,
NotInGC,
InConcurrentGC,
InPause,
PauseRequested,
Disabled(usize),
}Expand description
The status of MMTk’s GC subsystem. This doubles as the “is MMTk initialized” flag (via
GcStatus::Uninitialized) and as the state that tracks whether a GC is running and, if so,
what phase it is in. See GcStatusWord (the internal atomic encoding of this type) for how
this is stored atomically and which transitions between variants are legal.
Variants§
Uninitialized
MMTk has not been initialized yet, i.e. initialize_collection() has not been called, so
there are no GC worker threads available to run a collection.
NotInGC
MMTk is initialized, and no GC is running, pending, or requested.
InConcurrentGC
A concurrent GC’s background work (e.g. concurrent marking) is running while mutators
continue to run normally. See ConcurrentPlan::concurrent_work_in_progress.
InPause
A stop-the-world pause is active: mutators are stopped and GC workers are doing pause work (e.g. tracing).
PauseRequested
A GC pause has been requested (by GcStatusWord::try_request_pause) but mutators have
not all stopped yet.
Disabled(usize)
Collection is currently disabled (e.g. by a mutator calling disable_collection()).
The usize payload is the non-zero nesting depth of disable calls:
each call to disable_collection() increments the depth, and each call to enable_collection()
decrements it. When the depth is about to reach zero, the status is transitioned to NoInGC.
Trait Implementations§
impl Copy for GcStatus
impl StructuralPartialEq for GcStatus
Auto Trait Implementations§
impl Freeze for GcStatus
impl RefUnwindSafe for GcStatus
impl Send for GcStatus
impl Sync for GcStatus
impl Unpin for GcStatus
impl UnwindSafe for GcStatus
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
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>
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>
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)
&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> 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>
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