Struct mmtk::util::finalizable_processor::FinalizableProcessor
source · pub struct FinalizableProcessor<F: Finalizable> {
candidates: Vec<F>,
nursery_index: usize,
ready_for_finalize: Vec<F>,
}
Expand description
A special processor for Finalizable objects.
Fields§
§candidates: Vec<F>
Candidate objects that has finalizers with them
nursery_index: usize
Index into candidates to record where we are up to in the last scan of the candidates. Index after nursery_index are new objects inserted after the last GC.
ready_for_finalize: Vec<F>
Objects that can be finalized. They are actually dead, but we keep them alive until the binding pops them from the queue.
Implementations§
source§impl<F: Finalizable> FinalizableProcessor<F>
impl<F: Finalizable> FinalizableProcessor<F>
pub fn new() -> Self
pub fn add(&mut self, object: F)
fn forward_finalizable_reference<E: ProcessEdgesWork>( e: &mut E, finalizable: &mut F )
pub fn scan<E: ProcessEdgesWork>( &mut self, tls: VMWorkerThread, e: &mut E, nursery: bool )
pub fn forward_candidate<E: ProcessEdgesWork>( &mut self, e: &mut E, _nursery: bool )
pub fn forward_finalizable<E: ProcessEdgesWork>( &mut self, e: &mut E, _nursery: bool )
pub fn get_ready_object(&mut self) -> Option<F>
pub fn get_all_finalizers(&mut self) -> Vec<F>
pub fn get_finalizers_for(&mut self, object: ObjectReference) -> Vec<F>
Trait Implementations§
source§impl<F: Default + Finalizable> Default for FinalizableProcessor<F>
impl<F: Default + Finalizable> Default for FinalizableProcessor<F>
source§fn default() -> FinalizableProcessor<F>
fn default() -> FinalizableProcessor<F>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<F> RefUnwindSafe for FinalizableProcessor<F>where
F: RefUnwindSafe,
impl<F> Send for FinalizableProcessor<F>
impl<F> Sync for FinalizableProcessor<F>where
F: Sync,
impl<F> Unpin for FinalizableProcessor<F>where
F: Unpin,
impl<F> UnwindSafe for FinalizableProcessor<F>where
F: UnwindSafe,
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
§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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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>
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