From 13acea95b80890167d76b18e69838419b9979f07 Mon Sep 17 00:00:00 2001 From: Brooks Prumo Date: Wed, 15 Sep 2021 17:40:29 -0500 Subject: [PATCH] remove unused/incorrect DataBucket::bytes --- bucket_map/src/data_bucket.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bucket_map/src/data_bucket.rs b/bucket_map/src/data_bucket.rs index 83c152daf0..cd5e8c50ca 100644 --- a/bucket_map/src/data_bucket.rs +++ b/bucket_map/src/data_bucket.rs @@ -47,7 +47,6 @@ pub struct BucketMapStats { 23 8,388,608 24 16,777,216 */ -// bytes = 2^DEFAULT_CAPACITY const DEFAULT_CAPACITY_POW2: u8 = 5; #[repr(C)] @@ -79,7 +78,6 @@ pub struct DataBucket { mmap: MmapMut, pub cell_size: u64, pub capacity_pow2: u8, - pub bytes: u64, pub used: AtomicU64, pub stats: Arc, pub max_search: MaxSearch, @@ -116,7 +114,6 @@ impl DataBucket { used: AtomicU64::new(0), capacity_pow2, stats, - bytes: 1 << capacity_pow2, max_search, } } @@ -339,10 +336,9 @@ impl DataBucket { self.mmap = new_map; self.path = new_file; self.capacity_pow2 += increment; - self.bytes = 1 << self.capacity_pow2; remove_file(old_file).unwrap(); m.stop(); - let sz = self.bytes; + let sz = 1 << self.capacity_pow2; { let mut max = self.stats.max_size.lock().unwrap(); *max = std::cmp::max(*max, sz); @@ -351,6 +347,6 @@ impl DataBucket { self.stats.resize_us.fetch_add(m.as_us(), Ordering::Relaxed); } pub fn num_cells(&self) -> u64 { - self.bytes + 1 << self.capacity_pow2 } }