Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force fixed heap size when using NoGC #1264

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/util/heap/gc_trigger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,19 @@ impl<VM: VMBinding> GCTrigger<VM> {
GCTriggerSelector::FixedHeapSize(size) => Box::new(FixedHeapSizeTrigger {
total_pages: conversions::bytes_to_pages_up(size),
}),
GCTriggerSelector::DynamicHeapSize(min, max) => Box::new(MemBalancerTrigger::new(
conversions::bytes_to_pages_up(min),
conversions::bytes_to_pages_up(max),
)),
GCTriggerSelector::DynamicHeapSize(min, max) => 'dynamic_heap_size: {
let min_pages = conversions::bytes_to_pages_up(min);
let max_pages = conversions::bytes_to_pages_up(max);

if *options.plan == crate::util::options::PlanSelector::NoGC {
warn!("Cannot use dynamic heap size with NoGC. Using fixed heap size trigger instead.");
break 'dynamic_heap_size Box::new(FixedHeapSizeTrigger {
total_pages: max_pages,
});
}

Box::new(MemBalancerTrigger::new(min_pages, max_pages))
}
GCTriggerSelector::Delegated => {
<VM::VMCollection as crate::vm::Collection<VM>>::create_gc_trigger()
}
Expand Down
Loading