mmtk/plan/
mod.rs

1//! GC algorithms from the MMTk suite.
2//!
3//! This module provides various GC plans, each of which implements a GC algorithm.
4//! Generally a plan consists of a few parts:
5//! * A plan type that implements the [`Plan`] trait, which defines
6//!   spaces used in the plan, and their behaviors in GC and page accounting.
7//! * A mutator definition, which describes the mapping between allocators and allocation semantics,
8//!   and the mapping between allocators and spaces. If the plan needs barrier, the barrier definition is
9//!   also included here.
10//! * A constant for [`PlanConstraints`], which defines
11//!   plan-specific constants.
12//! * Plan-specific [`GCWork`](crate::scheduler::GCWork), which is scheduled during GC.
13//!
14//! For more about implementing a plan, it is recommended to read the [MMTk tutorial](/docs/tutorial/Tutorial.md).
15
16mod barriers;
17pub use barriers::BarrierSelector;
18
19mod gc_work;
20
21mod global;
22pub(crate) use global::create_gc_worker_context;
23pub(crate) use global::create_mutator;
24pub(crate) use global::create_plan;
25pub use global::AllocationSemantics;
26pub(crate) use global::CreateGeneralPlanArgs;
27pub(crate) use global::HasSpaces;
28pub use global::Plan;
29pub(crate) use global::PlanTraceObject;
30
31mod mutator_context;
32pub use mutator_context::Mutator;
33pub use mutator_context::MutatorContext;
34
35mod plan_constraints;
36pub use plan_constraints::PlanConstraints;
37pub(crate) use plan_constraints::DEFAULT_PLAN_CONSTRAINTS;
38
39mod tracing;
40pub use tracing::{ObjectQueue, ObjectsClosure, VectorObjectQueue, VectorQueue};
41
42/// Generational plans (with a copying nursery)
43mod generational;
44/// Sticky plans (using sticky marks for generational behaviors without a copying nursery)
45mod sticky;
46
47mod compressor;
48mod concurrent;
49mod immix;
50mod markcompact;
51mod marksweep;
52mod nogc;
53mod pageprotect;
54mod semispace;
55
56pub(crate) use generational::global::is_nursery_gc;
57pub(crate) use generational::global::GenerationalPlan;
58
59// Expose plan constraints as public. Though a binding can get them from plan.constraints(),
60// it is possible for performance reasons that they want the constraints as constants.
61
62pub use generational::copying::GENCOPY_CONSTRAINTS;
63pub use generational::immix::GENIMMIX_CONSTRAINTS;
64pub use immix::IMMIX_CONSTRAINTS;
65pub use markcompact::MARKCOMPACT_CONSTRAINTS;
66pub use marksweep::MS_CONSTRAINTS;
67pub use nogc::NOGC_CONSTRAINTS;
68pub use pageprotect::PP_CONSTRAINTS;
69pub use semispace::SS_CONSTRAINTS;
70pub use sticky::immix::STICKY_IMMIX_CONSTRAINTS;