From 4a04fcaac683b9f428b988646740984b1944b863 Mon Sep 17 00:00:00 2001 From: Guillume DIDIER Date: Tue, 5 Jan 2021 11:43:20 +0100 Subject: [PATCH] Fix add assign implemntation bug --- cache_utils/src/calibration.rs | 4 ++-- cache_utils/src/main.rs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cache_utils/src/calibration.rs b/cache_utils/src/calibration.rs index 39af87c..caec494 100644 --- a/cache_utils/src/calibration.rs +++ b/cache_utils/src/calibration.rs @@ -1050,8 +1050,8 @@ impl AddAssign<&RawHistogram> for RawHistogram { assert_eq!(self.hit.len(), self.miss.len()); for i in 0..self.hit.len() { - self.hit[i] + rhs.hit[i]; - self.miss[i] + rhs.miss[i]; + self.hit[i] += rhs.hit[i]; + self.miss[i] += rhs.miss[i]; } } } diff --git a/cache_utils/src/main.rs b/cache_utils/src/main.rs index 93ddab1..c4a7502 100644 --- a/cache_utils/src/main.rs +++ b/cache_utils/src/main.rs @@ -4,7 +4,6 @@ //fn execute_on_core(FnOnce) - use cache_utils::calibration::calibrate_flush; use cache_utils::calibration::Verbosity; @@ -41,7 +40,10 @@ pub fn main() { // Let's grab all the list of CPUS // Then iterate the calibration on each CPU core. - eprintln!("CPU MicroArch: {:?}", MicroArchitecture::get_micro_architecture()); + eprintln!( + "CPU MicroArch: {:?}", + MicroArchitecture::get_micro_architecture() + ); eprint!("Warming up..."); for i in 0..(CpuSet::count() - 1) { if old.is_set(i).unwrap() {