From dc80b3eba437db5055e4009c22a2e9b1b62e3231 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Wed, 3 Apr 2024 11:31:25 +0800 Subject: [PATCH] Use proper logging for the treadmill (#1101) This replaces the print statements with the `trace!` macro so that the logging can be enabled at run time and actually used for debugging. --- src/util/treadmill.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/treadmill.rs b/src/util/treadmill.rs index 391256a432..e8cfe92d4f 100644 --- a/src/util/treadmill.rs +++ b/src/util/treadmill.rs @@ -34,10 +34,10 @@ impl TreadMill { pub fn add_to_treadmill(&self, object: ObjectReference, nursery: bool) { if nursery { - // println!("+ an {}", cell); + trace!("Adding {} to nursery", object); self.alloc_nursery.lock().unwrap().insert(object); } else { - // println!("+ ts {}", cell); + trace!("Adding {} to to_space", object); self.to_space.lock().unwrap().insert(object); } } @@ -93,10 +93,10 @@ impl TreadMill { pub fn flip(&mut self, full_heap: bool) { swap(&mut self.alloc_nursery, &mut self.collect_nursery); - // println!("an <-> cn"); + trace!("Flipped alloc_nursery and collect_nursery"); if full_heap { swap(&mut self.from_space, &mut self.to_space); - // println!("fs <-> ts"); + trace!("Flipped from_space and to_space"); } } }