pub struct GCWorkerCopyContext<VM: VMBinding> {
pub copy: [MaybeUninit<CopySpaceCopyContext<VM>>; 1],
pub immix: [MaybeUninit<ImmixCopyContext<VM>>; 1],
pub immix_hybrid: [MaybeUninit<ImmixHybridCopyContext<VM>>; 1],
config: CopyConfig<VM>,
}Expand description
The thread local struct for each GC worker for copying. Each GC worker should include one instance of this struct for copying operations.
Fields§
§copy: [MaybeUninit<CopySpaceCopyContext<VM>>; 1]Copy allocators for CopySpace
immix: [MaybeUninit<ImmixCopyContext<VM>>; 1]Copy allocators for ImmixSpace
immix_hybrid: [MaybeUninit<ImmixHybridCopyContext<VM>>; 1]Copy allocators for ImmixSpace
config: CopyConfig<VM>The config for the plan
Implementations§
source§impl<VM: VMBinding> GCWorkerCopyContext<VM>
impl<VM: VMBinding> GCWorkerCopyContext<VM>
sourcepub fn alloc_copy(
&mut self,
original: ObjectReference,
bytes: usize,
align: usize,
offset: usize,
semantics: CopySemantics,
) -> Address
pub fn alloc_copy( &mut self, original: ObjectReference, bytes: usize, align: usize, offset: usize, semantics: CopySemantics, ) -> Address
Allocate for the object for GC copying.
Arguments:
original: The original object that will be copied.bytes: The size in bytes for the allocation.align: The alignment in bytes for the allocation.offset: The offset in bytes for the allocation.semantics: The copy semantic for this coying allocation. It determins which copy allocator will be used for the copying.
sourcepub fn post_copy(
&mut self,
object: ObjectReference,
bytes: usize,
semantics: CopySemantics,
)
pub fn post_copy( &mut self, object: ObjectReference, bytes: usize, semantics: CopySemantics, )
Post allocation after allocating an object.
Arguments:
object: The newly allocated object (the new object after copying).bytes: The size of the object in bytes.semantics: The copy semantic used for the copying.
sourcepub fn new(
worker_tls: VMWorkerThread,
mmtk: &MMTK<VM>,
config: CopyConfig<VM>,
) -> Self
pub fn new( worker_tls: VMWorkerThread, mmtk: &MMTK<VM>, config: CopyConfig<VM>, ) -> Self
Create a GCWorkerCopyContext based on the configuration for a copying plan.
Arguments:
worker_tls: The worker thread for this copy context.plan: A reference to the current plan.config: The configuration for the copy context.
sourcepub fn new_non_copy() -> Self
pub fn new_non_copy() -> Self
Create a stub GCWorkerCopyContext for non copying plans.
Auto Trait Implementations§
impl<VM> Freeze for GCWorkerCopyContext<VM>
impl<VM> !RefUnwindSafe for GCWorkerCopyContext<VM>
impl<VM> Send for GCWorkerCopyContext<VM>
impl<VM> Sync for GCWorkerCopyContext<VM>
impl<VM> Unpin for GCWorkerCopyContext<VM>
impl<VM> !UnwindSafe for GCWorkerCopyContext<VM>
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>
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