Structsยง
- This provides an implementation of
crate::scheduler::gc_work::ProcessEdgesWork. A plan that implementsPlanTraceObjectcan use this work packet for tracing objects. - This is an alternative to
ScanObjectsthat calls thepost_scan_objectof the policy selected by the plan. It is applicable to plans that derivePlanTraceObject. - The global GC Preparation Work This work packet invokes prepare() for the plan (which will invoke prepare() for each space), and pushes work packets for preparing mutators and collectors. We should only have one such work packet per GC, before any actual GC work starts. We assume this work packet is the only running work packet that accesses plan, and there should be no other concurrent work packet that accesses plan (read or write). Otherwise, there may be a race condition.
- The collector GC Preparation Work
- The mutator GC Preparation Work
- An implementation of
RootsWorkFactorythat creates work packets based onProcessEdgesWorkfor handling roots. TheDPEand thePPEtype parameters correspond to theDefaultProcessEdgeand thePinningProcessEdgestype members of theGCWorkContexttrait. - This implements
ObjectTracerby forwarding thetrace_objectcalls to the wrappedProcessEdgesWorkinstance. - This type implements
ObjectTracerContextby creating a temporaryProcessEdgesWorkduring the call towith_tracer, making use of itstrace_objectmethod. It then creates work packets using the methods of theProcessEdgesWorkand add the work packet into the givenstage. - Process
Root ๐Nodes This work packet processes pinning roots. - The global GC release Work This work packet invokes release() for the plan (which will invoke release() for each space), and pushes work packets for releasing mutators and collectors. We should only have one such work packet per GC, after all actual GC work ends. We assume this work packet is the only running work packet that accesses plan, and there should be no other concurrent work packet that accesses plan (read or write). Otherwise, there may be a race condition.
- The collector release Work
- The mutator release Work
- A general implementation of
ProcessEdgesWorkusing SFT. A plan can always implement their ownProcessEdgesWorkinstances. However, most plans can use this work packet for tracing amd they do not need to provide a plan-specific trace object work packet. If they choose to use this type, they need to provide a correct implementation for some related methods (such asSpace.set_copy_for_sft_trace(),SFT.sft_trace_object()). Some plans are not using this type, mostly due to more complex tracing. Either it is impossible to use this type, or there is performance overheads for using this general trace type. In such cases, they implement their specificProcessEdgesWorkinstances. - Scan objects and enqueue the slots of the objects. For objects that do not support slot-enqueuing, this work packet also traces their outgoing edges directly.
- Stop all mutators
- A
ProcessEdgesWorktype that panics when any of its method is used. This is currently used for plans that do not support transitively pinning. - Delegate to the VM binding for forwarding weak references.
- This work packet calls
Collection::post_forwarding. - Delegate to the VM binding for weak reference processing.
Enumsยง
- Roots
Kind ๐For USDT tracepoints for roots. Keep in sync withtools/tracing/timeline/visualize.py.
Traitsยง
- An abstract trait for work packets that process object graph edges. Its method
ProcessEdgesWork::trace_objecttraces an object and, upon first visit, enqueues it into an internal queue inside theProcessEdgesWorkinstance. Each implementation of this trait implementtrace_objectdifferently. DuringPlan::schedule_collection, plans select (usually viaGCWorkContext) specialized implementations of this trait to be used during each trace according the nature of each trace, such as whether it is a nursery collection, whether it is a defrag collection, whether it pins objects, etc. - Trait for a work packet that scans objects
Type Aliasesยง
- A short-hand for
<E::VM as VMBinding>::VMSlot.