From db1f36caa00946671c501f468d88094d146b2ef7 Mon Sep 17 00:00:00 2001 From: Matt Valentine-House Date: Thu, 17 Oct 2024 13:35:03 +0100 Subject: [PATCH] Allow the plan to be overridden after setting the default Instead of setting it from the environment and then reverting it back to MMTk if it's still using the default plan. --- gc/mmtk/src/api.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gc/mmtk/src/api.rs b/gc/mmtk/src/api.rs index 1f02747ef0deb6..e5f0fcfcb3b583 100644 --- a/gc/mmtk/src/api.rs +++ b/gc/mmtk/src/api.rs @@ -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::().unwrap(); - builder.options.plan.set(plan_selector); - } + // Set the default plan to MarkSweep + let plan_selector = "MarkSweep".parse::().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));