Trait mmtk::scheduler::work::GCWorkContext
source · pub trait GCWorkContext: Send + 'static {
type VM: VMBinding;
type PlanType: Plan<VM = Self::VM>;
type DefaultProcessEdges: ProcessEdgesWork<VM = Self::VM>;
type PinningProcessEdges: ProcessEdgesWork<VM = Self::VM>;
}
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§
type VM: VMBinding
type PlanType: Plan<VM = Self::VM>
sourcetype DefaultProcessEdges: ProcessEdgesWork<VM = Self::VM>
type DefaultProcessEdges: ProcessEdgesWork<VM = Self::VM>
The ProcessEdgesWork
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.
sourcetype PinningProcessEdges: ProcessEdgesWork<VM = Self::VM>
type PinningProcessEdges: ProcessEdgesWork<VM = Self::VM>
The ProcessEdgesWork
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,
PinningProcessEdges
will be used to trace the edges from roots to objects, but their descendents will be traced usingDefaultProcessEdges
. - For transitive pinning roots,
PinningProcessEdges
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 UnsupportedProcessEdges
for this
type member.