Skip to content

Commit

Permalink
Use proper logging for the treadmill (#1101)
Browse files Browse the repository at this point in the history
This replaces the print statements with the `trace!` macro so that the
logging can be enabled at run time and actually used for debugging.
  • Loading branch information
wks authored Apr 3, 2024
1 parent d91b203 commit dc80b3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util/treadmill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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");
}
}
}
Expand Down

0 comments on commit dc80b3e

Please sign in to comment.