simple refactorings to disk idx (#27238)

This commit is contained in:
Jeff Washington (jwash) 2022-08-19 12:40:42 -05:00 committed by GitHub
parent 6f045d6080
commit 2031e0afaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -412,7 +412,8 @@ impl<T: IndexValue> PreAllocatedAccountMapEntry<T> {
account_info: T,
storage: &Arc<BucketMapHolder<T>>,
) -> AccountMapEntry<T> {
let ref_count = if account_info.is_cached() { 0 } else { 1 };
let is_cached = account_info.is_cached();
let ref_count = if is_cached { 0 } else { 1 };
let meta = AccountMapEntryMeta::new_dirty(storage);
Arc::new(AccountMapEntryInner::new(
vec![(slot, account_info)],

View File

@ -31,6 +31,7 @@ pub struct BucketMapHolder<T: IndexValue> {
pub disk: Option<BucketMap<(Slot, T)>>,
pub count_buckets_flushed: AtomicUsize,
/// rolling 'current' age
pub age: AtomicU8,
pub stats: BucketMapHolderStats,