Module mmtk::plan::global

source ·
Expand description

The global part of a plan implementation.


  • BasePlan should contain all plan-related state and functions that are fundamental to all plans. These include VM-specific (but not plan-specific) features such as a code space or vm space, which are fundamental to all plans for a given VM. Features that are common to many (but not intrinsically all) plans should instead be included in CommonPlan.
  • CommonPlan is for representing state and features used by many plans, but that are not fundamental to all plans. Examples include the Large Object Space and an Immortal space. Features that are fundamental to all plans must be included in BasePlan.
  • Args needed for creating any plan. This includes a set of contexts from MMTK or global. This is passed to each plan’s constructor.
  • Args needed for creating a specific plan. This includes plan-specific args, such as plan constrainst and their global side metadata specs. This is created in each plan’s constructor, and will be passed to CommonPlan or BasePlan. Also you can create PlanCreateSpaceArg from this type, and use that to create spaces.


  • Allocation semantics that MMTk provides. Each allocation request requires a desired semantic for the object to allocate.


  • A trait for anything that contains spaces. Examples include concrete plans as well as Gen, CommonPlan and BasePlan. All plans must implement this trait.
  • A plan describes the global core functionality for all memory management schemes. All global MMTk plans should implement this trait.
  • A plan that uses PlanProcessEdges needs to provide an implementation for this trait. Generally a plan does not need to manually implement this trait. Instead, we provide a procedural macro that helps generate an implementation. Please check macros/trace_object.