diff --git a/bucket_map/src/bucket.rs b/bucket_map/src/bucket.rs index d44af64e55..5d3bc91c53 100644 --- a/bucket_map/src/bucket.rs +++ b/bucket_map/src/bucket.rs @@ -169,7 +169,7 @@ impl Bucket { elem.key = *key; elem.ref_count = ref_count; elem.data_location = 0; - elem.create_bucket_capacity_pow2 = 0; + elem.bucket_capacity_when_created_pow2 = 0; elem.num_slots = 0; //debug!( "INDEX ALLOC {:?} {} {} {}", key, ii, index.capacity, elem_uid ); return Ok(ii); @@ -257,7 +257,7 @@ impl Bucket { } // elem: &mut IndexEntry = self.index.get_mut(elem_ix); elem.data_location = ix; - elem.create_bucket_capacity_pow2 = best_bucket.capacity_pow2; + elem.bucket_capacity_when_created_pow2 = best_bucket.capacity_pow2; elem.num_slots = data.len() as u64; //debug!( "DATA ALLOC {:?} {} {} {}", key, elem.data_location, best_bucket.capacity, elem_uid ); if elem.num_slots > 0 { diff --git a/bucket_map/src/index_entry.rs b/bucket_map/src/index_entry.rs index d1ccf8357b..f813932588 100644 --- a/bucket_map/src/index_entry.rs +++ b/bucket_map/src/index_entry.rs @@ -16,7 +16,7 @@ pub struct IndexEntry { pub ref_count: RefCount, // can this be smaller? Do we ever need more than 4B refcounts? pub data_location: u64, // smaller? since these are variably sized, this could get tricky. well, actually accountinfo is not variable sized... // if the bucket doubled, the index can be recomputed using create_bucket_capacity_pow2 - pub create_bucket_capacity_pow2: u8, // see data_location + pub bucket_capacity_when_created_pow2: u8, // see data_location pub num_slots: Slot, // can this be smaller? epoch size should ~ be the max len. this is the num elements in the slot list } @@ -36,7 +36,7 @@ impl IndexEntry { // This function maps the original data location into an index in the current data bucket. // This is coupled with how we resize data buckets. pub fn data_loc(&self, bucket: &DataBucket) -> u64 { - self.data_location << (bucket.capacity_pow2 - self.create_bucket_capacity_pow2) + self.data_location << (bucket.capacity_pow2 - self.bucket_capacity_when_created_pow2) } pub fn read_value<'a, T>(&self, bucket: &'a Bucket) -> Option<(&'a [T], RefCount)> {