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>

source

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.
source

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.
source

pub fn prepare(&mut self)

Prepare the copying allocators.

source

pub fn release(&mut self)

Release the copying allocators.

source

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.
source

pub fn new_non_copy() -> Self

Create a stub GCWorkerCopyContext for non copying plans.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: 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>

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)

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)

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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.