From bed0049a5118d7f02263225a54b083e7558ad20d Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Sat, 18 Sep 2021 09:56:26 -0500 Subject: [PATCH] AcctIdx: add age per item in in_mem acct idx (#19981) --- runtime/src/accounts_index.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index cf74cb5c75..f20cc061a8 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -25,7 +25,7 @@ use std::{ }, path::PathBuf, sync::{ - atomic::{AtomicBool, AtomicU64, Ordering}, + atomic::{AtomicBool, AtomicU64, AtomicU8, Ordering}, Arc, Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard, }, }; @@ -127,12 +127,14 @@ impl AccountSecondaryIndexes { #[derive(Debug, Default)] pub struct AccountMapEntryMeta { pub dirty: AtomicBool, + pub age: AtomicU8, } impl AccountMapEntryMeta { pub fn new_dirty() -> Self { AccountMapEntryMeta { dirty: AtomicBool::new(true), + age: AtomicU8::default(), } } }