AcctIdx: add age per item in in_mem acct idx (#19981)

This commit is contained in:
Jeff Washington (jwash) 2021-09-18 09:56:26 -05:00 committed by GitHub
parent 8df8f4396d
commit bed0049a51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -25,7 +25,7 @@ use std::{
}, },
path::PathBuf, path::PathBuf,
sync::{ sync::{
atomic::{AtomicBool, AtomicU64, Ordering}, atomic::{AtomicBool, AtomicU64, AtomicU8, Ordering},
Arc, Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard, Arc, Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard,
}, },
}; };
@ -127,12 +127,14 @@ impl AccountSecondaryIndexes {
#[derive(Debug, Default)] #[derive(Debug, Default)]
pub struct AccountMapEntryMeta { pub struct AccountMapEntryMeta {
pub dirty: AtomicBool, pub dirty: AtomicBool,
pub age: AtomicU8,
} }
impl AccountMapEntryMeta { impl AccountMapEntryMeta {
pub fn new_dirty() -> Self { pub fn new_dirty() -> Self {
AccountMapEntryMeta { AccountMapEntryMeta {
dirty: AtomicBool::new(true), dirty: AtomicBool::new(true),
age: AtomicU8::default(),
} }
} }
} }