@@ -440,12 +440,10 @@ impl<VM: VMBinding> ImmixSpace<VM> {
440440 }
441441 }
442442
443- /// Release for the immix space. This is called when a GC finished.
444- /// Return whether this GC was a defrag GC, as a plan may want to know this.
445- pub fn release ( & mut self , major_gc : bool ) -> bool {
446- let did_defrag = self . defrag . in_defrag ( ) ;
443+ /// Release for the immix space.
444+ pub fn release ( & mut self , major_gc : bool ) {
447445 if major_gc {
448- // Update line_unavail_state for hole searching afte this GC.
446+ // Update line_unavail_state for hole searching after this GC.
449447 if !super :: BLOCK_ONLY {
450448 self . line_unavail_state . store (
451449 self . line_mark_state . load ( Ordering :: Acquire ) ,
@@ -460,12 +458,17 @@ impl<VM: VMBinding> ImmixSpace<VM> {
460458 // Sweep chunks and blocks
461459 let work_packets = self . generate_sweep_tasks ( ) ;
462460 self . scheduler ( ) . work_buckets [ WorkBucketStage :: Release ] . bulk_add ( work_packets) ;
463- if super :: DEFRAG {
464- self . defrag . release ( self ) ;
465- }
466461
467462 self . lines_consumed . store ( 0 , Ordering :: Relaxed ) ;
463+ }
468464
465+ /// This is called when a GC finished.
466+ /// Return whether this GC was a defrag GC, as a plan may want to know this.
467+ pub fn end_of_gc ( & mut self ) -> bool {
468+ let did_defrag = self . defrag . in_defrag ( ) ;
469+ if super :: DEFRAG {
470+ self . defrag . reset_in_defrag ( ) ;
471+ }
469472 did_defrag
470473 }
471474
0 commit comments