Skip to content

Commit 61d26db

Browse files
committed
Fix
1 parent 836cac5 commit 61d26db

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/plan/sticky/immix/global.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ impl<VM: VMBinding> crate::plan::generational::global::GenerationalPlanExt<VM> f
262262
self.immix
263263
.immix_space
264264
.trace_object_without_moving(queue, object)
265-
} else if self.immix.immix_space.is_nursery_copy_enabled() {
265+
} else if self.immix.immix_space.prefer_copy_on_nursery_gc() {
266266
let ret = self.immix.immix_space.trace_object_with_opportunistic_copy(
267267
queue,
268268
object,

src/policy/immix/defrag.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,20 @@ impl Defrag {
6565
/// Determine whether the current GC should do defragmentation.
6666
pub fn decide_whether_to_defrag(
6767
&self,
68+
defrag_enabled: bool,
6869
emergency_collection: bool,
6970
collect_whole_heap: bool,
7071
collection_attempts: usize,
7172
user_triggered: bool,
7273
exhausted_reusable_space: bool,
7374
full_heap_system_gc: bool,
7475
) {
75-
let in_defrag = emergency_collection
76-
|| (collection_attempts > 1)
77-
|| !exhausted_reusable_space
78-
|| super::STRESS_DEFRAG
79-
|| (collect_whole_heap && user_triggered && full_heap_system_gc);
76+
let in_defrag = defrag_enabled
77+
&& (emergency_collection
78+
|| (collection_attempts > 1)
79+
|| !exhausted_reusable_space
80+
|| super::STRESS_DEFRAG
81+
|| (collect_whole_heap && user_triggered && full_heap_system_gc));
8082
info!("Defrag: {}", in_defrag);
8183
probe!(mmtk, immix_defrag, in_defrag);
8284
self.in_defrag_collection

src/policy/immix/immixspace.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl<VM: VMBinding> SFT for ImmixSpace<VM> {
124124
VM::VMObjectModel::LOCAL_PINNING_BIT_SPEC.is_object_pinned::<VM>(object)
125125
}
126126
fn is_movable(&self) -> bool {
127-
!self.is_defrag_enabled() && !self.is_nursery_copy_enabled()
127+
!self.space_args.never_move_objects
128128
}
129129

130130
#[cfg(feature = "sanity")]
@@ -369,10 +369,8 @@ impl<VM: VMBinding> ImmixSpace<VM> {
369369
user_triggered_collection: bool,
370370
full_heap_system_gc: bool,
371371
) -> bool {
372-
if !self.is_defrag_enabled() {
373-
return false;
374-
}
375372
self.defrag.decide_whether_to_defrag(
373+
self.is_defrag_enabled(),
376374
emergency_collection,
377375
collect_whole_heap,
378376
collection_attempts,
@@ -896,7 +894,7 @@ impl<VM: VMBinding> GCWork<VM> for PrepareBlockState<VM> {
896894
continue;
897895
}
898896
// Check if this block needs to be defragmented.
899-
let is_defrag_source = if self.space.space_args.never_move_objects {
897+
let is_defrag_source = if !self.space.is_defrag_enabled() {
900898
// Do not set any block as defrag source if defrag is disabled.
901899
false
902900
} else if super::DEFRAG_EVERY_BLOCK {

0 commit comments

Comments
 (0)