@@ -39,9 +39,9 @@ pub struct GenImmix<VM: VMBinding> {
3939 /// An immix space as the mature space.
4040 pub immix : ImmixSpace < VM > ,
4141 /// Whether the last GC was a defrag GC for the immix space.
42- // This is not used. It should be used for last_collection_was_exhaustive.
43- // TODO: We need to fix this.
4442 pub last_gc_was_defrag : AtomicBool ,
43+ /// Whether the last GC was a full heap GC
44+ pub last_gc_was_full_heap : AtomicBool ,
4545}
4646
4747pub const GENIMMIX_CONSTRAINTS : PlanConstraints = PlanConstraints {
@@ -76,7 +76,10 @@ impl<VM: VMBinding> Plan for GenImmix<VM> {
7676 }
7777
7878 fn last_collection_was_exhaustive ( & self ) -> bool {
79- self . last_gc_was_defrag . load ( Ordering :: Relaxed )
79+ self . last_gc_was_full_heap . load ( Ordering :: Relaxed )
80+ && ImmixSpace :: < VM > :: is_last_gc_exhaustive (
81+ self . last_gc_was_defrag . load ( Ordering :: Relaxed ) ,
82+ )
8083 }
8184
8285 fn force_full_heap_collection ( & self ) {
@@ -163,6 +166,8 @@ impl<VM: VMBinding> Plan for GenImmix<VM> {
163166 } else {
164167 self . last_gc_was_defrag . store ( false , Ordering :: Relaxed ) ;
165168 }
169+ self . last_gc_was_full_heap
170+ . store ( full_heap, Ordering :: Relaxed ) ;
166171 }
167172
168173 fn get_collection_reserve ( & self ) -> usize {
@@ -227,6 +232,7 @@ impl<VM: VMBinding> GenImmix<VM> {
227232 ) ,
228233 immix : immix_space,
229234 last_gc_was_defrag : AtomicBool :: new ( false ) ,
235+ last_gc_was_full_heap : AtomicBool :: new ( false ) ,
230236 } ;
231237
232238 // Use SideMetadataSanity to check if each spec is valid. This is also needed for check
0 commit comments