GCWorkContext

Trait GCWorkContext 

Source
pub trait GCWorkContext: Send + 'static {
    type VM: VMBinding;
    type PlanType: Plan<VM = Self::VM>;
    type DefaultTrace: Trace<VM = Self::VM>;
    type PinningTrace: Trace<VM = Self::VM>;

    // Provided method
    fn make_roots_work_factory(
        mmtk: &'static MMTK<Self::VM>,
    ) -> impl RootsWorkFactory<<Self::VM as VMBinding>::VMSlot> { ... }
}
Expand description

This trait provides a group of associated types that are needed to create GC work packets for a certain plan. For example, GCWorkScheduler.schedule_common_work() needs this trait to schedule different work packets. For certain plans, they may need to provide several types that implement this trait, e.g. one for nursery GC, one for mature GC.

Note: Because GCWorkContext is often used as parameters of implementations of GCWork, we let GCWorkContext require Send + 'static. Since GCWorkContext is just a group of associated types, its implementations should not have any actual fields other than PhantomData, and will automatically have Send + 'static.

Required Associated Types§

Source

type VM: VMBinding

Source

type PlanType: Plan<VM = Self::VM>

Source

type DefaultTrace: Trace<VM = Self::VM>

The Trace implementation to use for tracing edges that do not have special pinning requirements. Concrete plans and spaces may choose to move or not to move the objects the traced edges point to.

Source

type PinningTrace: Trace<VM = Self::VM>

The Trace implementation to use for tracing edges that must not be updated (i.e. the objects the traced edges pointed to must not be moved). This is used for implementing pinning roots and transitive pinning roots.

  • For non-transitive pinning roots, Self::PinningTrace will be used to trace the edges from roots to objects, but their descendents will be traced using Self::DefaultTrace.
  • For transitive pinning roots, Self::PinningTrace will be used to trace the edges from roots to objects, and will also be used to trace the outgoing edges of all objects reachable from transitive pinning roots.

If a plan does not support object pinning, it should use UnsupportedTrace for this type member.

Provided Methods§

Source

fn make_roots_work_factory( mmtk: &'static MMTK<Self::VM>, ) -> impl RootsWorkFactory<<Self::VM as VMBinding>::VMSlot>

Create an instance of RootsWorkFactory for root scanning in the current GC.

The default implementation creates DefaultRootsWorkFactory which is sufficient for stop-the-world tracing GC. Plans that need custom RootsWorkFactory implementations can override this method.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<VM: VMBinding> GCWorkContext for CompressorForwardingWorkContext<VM>

Source§

impl<VM: VMBinding> GCWorkContext for CompressorWorkContext<VM>

Source§

impl<VM: VMBinding> GCWorkContext for ConcurrentImmixGCWorkContext<VM>

Source§

impl<VM: VMBinding> GCWorkContext for GenCopyGCWorkContext<VM>

Source§

impl<VM: VMBinding> GCWorkContext for GenCopyNurseryGCWorkContext<VM>

Source§

impl<VM: VMBinding> GCWorkContext for GenImmixNurseryGCWorkContext<VM>

Source§

impl<VM: VMBinding> GCWorkContext for MarkCompactForwardingGCWorkContext<VM>

Source§

impl<VM: VMBinding> GCWorkContext for MarkCompactGCWorkContext<VM>

Source§

impl<VM: VMBinding> GCWorkContext for MSGCWorkContext<VM>

Source§

type VM = VM

Source§

type PlanType = MarkSweep<VM>

Source§

type DefaultTrace = PlanTrace<MarkSweep<VM>, DEFAULT_TRACE>

Source§

type PinningTrace = PlanTrace<MarkSweep<VM>, DEFAULT_TRACE>

Source§

impl<VM: VMBinding> GCWorkContext for PPGCWorkContext<VM>

Source§

type VM = VM

Source§

type PlanType = PageProtect<VM>

Source§

type DefaultTrace = PlanTrace<PageProtect<VM>, DEFAULT_TRACE>

Source§

type PinningTrace = PlanTrace<PageProtect<VM>, DEFAULT_TRACE>

Source§

impl<VM: VMBinding> GCWorkContext for SSGCWorkContext<VM>

Source§

impl<VM: VMBinding> GCWorkContext for StickyImmixNurseryGCWorkContext<VM>

Source§

impl<VM: VMBinding, const KIND: u8> GCWorkContext for ConcurrentImmixSTWGCWorkContext<VM, KIND>

Source§

impl<VM: VMBinding, const KIND: u8> GCWorkContext for GenImmixMatureGCWorkContext<VM, KIND>

Source§

impl<VM: VMBinding, const KIND: u8> GCWorkContext for ImmixGCWorkContext<VM, KIND>

Source§

type VM = VM

Source§

type PlanType = Immix<VM>

Source§

type DefaultTrace = PlanTrace<Immix<VM>, KIND>

Source§

type PinningTrace = PlanTrace<Immix<VM>, TRACE_KIND_TRANSITIVE_PIN>

Source§

impl<VM: VMBinding, const KIND: u8> GCWorkContext for StickyImmixMatureGCWorkContext<VM, KIND>