Skip to content

Commit bd3305f

Browse files
committed
Zeroing the live bytes right before GC starts
1 parent ee21a9c commit bd3305f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/policy/immix/immixspace.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ impl<VM: VMBinding> ImmixSpace<VM> {
450450
self.scheduler.work_buckets[WorkBucketStage::ClearVOBits].bulk_add(work_packets);
451451
}
452452
}
453+
454+
#[cfg(feature = "count_live_bytes_immixspace")]
455+
self.set_live_bytes(0);
453456
}
454457

455458
/// Release for the immix space. This is called when a GC finished.
@@ -847,6 +850,11 @@ impl<VM: VMBinding> ImmixSpace<VM> {
847850
self.live_bytes_in_immixspace.load(Ordering::SeqCst)
848851
}
849852

853+
#[cfg(feature = "count_live_bytes_immixspace")]
854+
pub fn set_live_bytes(&self, size: usize) {
855+
self.live_bytes_in_immixspace.store(size, Ordering::SeqCst)
856+
}
857+
850858
#[cfg(feature = "count_live_bytes_immixspace")]
851859
pub fn increase_live_bytes(&self, size: usize) {
852860
self.live_bytes_in_immixspace

0 commit comments

Comments
 (0)