simple refactorings to disk idx (#27238)
This commit is contained in:
parent
6f045d6080
commit
2031e0afaf
|
@ -412,7 +412,8 @@ impl<T: IndexValue> PreAllocatedAccountMapEntry<T> {
|
||||||
account_info: T,
|
account_info: T,
|
||||||
storage: &Arc<BucketMapHolder<T>>,
|
storage: &Arc<BucketMapHolder<T>>,
|
||||||
) -> AccountMapEntry<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);
|
let meta = AccountMapEntryMeta::new_dirty(storage);
|
||||||
Arc::new(AccountMapEntryInner::new(
|
Arc::new(AccountMapEntryInner::new(
|
||||||
vec![(slot, account_info)],
|
vec![(slot, account_info)],
|
||||||
|
|
|
@ -31,6 +31,7 @@ pub struct BucketMapHolder<T: IndexValue> {
|
||||||
pub disk: Option<BucketMap<(Slot, T)>>,
|
pub disk: Option<BucketMap<(Slot, T)>>,
|
||||||
|
|
||||||
pub count_buckets_flushed: AtomicUsize,
|
pub count_buckets_flushed: AtomicUsize,
|
||||||
|
/// rolling 'current' age
|
||||||
pub age: AtomicU8,
|
pub age: AtomicU8,
|
||||||
pub stats: BucketMapHolderStats,
|
pub stats: BucketMapHolderStats,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue