Skip to content

Commit

Permalink
Allow the plan to be overridden after setting the default
Browse files Browse the repository at this point in the history
Instead of setting it from the environment and then reverting it back to
MMTk if it's still using the default plan.
  • Loading branch information
eightbitraptor committed Oct 17, 2024
1 parent 2705358 commit db1f36c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gc/mmtk/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ pub extern "C" fn mmtk_builder_default() -> *mut MMTKBuilder {
let mut builder = MMTKBuilder::new();
builder.options.no_finalizer.set(true);

// TODO(@mattvh): Clean up this hack
if matches!(*builder.options.plan, PlanSelector::GenImmix) {
let plan_selector = "MarkSweep".parse::<PlanSelector>().unwrap();
builder.options.plan.set(plan_selector);
}
// Set the default plan to MarkSweep
let plan_selector = "MarkSweep".parse::<PlanSelector>().unwrap();
builder.options.plan.set(plan_selector);

// And allow the environment to override it
builder.options.read_env_var_settings();

// Between 1MiB and 500MiB
builder.options.gc_trigger.set(GCTriggerSelector::DynamicHeapSize(1 << 20, 500 << 20));
Expand Down

0 comments on commit db1f36c

Please sign in to comment.