From 5a9956824f807682c1ee5d8879c1eae14581b9e1 Mon Sep 17 00:00:00 2001 From: Brooks Date: Wed, 4 Oct 2023 13:26:31 -0400 Subject: [PATCH] Uses `IntSet` for `RootsTracker::uncleaned_roots` (#33524) --- accounts-db/src/accounts_index.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/accounts-db/src/accounts_index.rs b/accounts-db/src/accounts_index.rs index f1c0b4e909..cd37df6169 100644 --- a/accounts-db/src/accounts_index.rs +++ b/accounts-db/src/accounts_index.rs @@ -20,6 +20,7 @@ use { ThreadPool, }, solana_measure::measure::Measure, + solana_nohash_hasher::IntSet, solana_sdk::{ account::ReadableAccount, clock::{BankId, Slot}, @@ -457,7 +458,7 @@ pub struct RootsTracker { /// Updated every time we add a new root or clean/shrink an append vec into irrelevancy. /// Range is approximately the last N slots where N is # slots per epoch. pub alive_roots: RollingBitField, - uncleaned_roots: HashSet, + uncleaned_roots: IntSet, } impl Default for RootsTracker { @@ -473,7 +474,7 @@ impl RootsTracker { pub fn new(max_width: u64) -> Self { Self { alive_roots: RollingBitField::new(max_width), - uncleaned_roots: HashSet::new(), + uncleaned_roots: IntSet::default(), } } @@ -1994,7 +1995,7 @@ impl + Into> AccountsIndex { tracker.alive_roots.get_all() } - pub fn clone_uncleaned_roots(&self) -> HashSet { + pub fn clone_uncleaned_roots(&self) -> IntSet { self.roots_tracker.read().unwrap().uncleaned_roots.clone() }