AcctIdx: support unref first class for perf (#20638)
This commit is contained in:
parent
e11f1b3e9e
commit
9b042fed30
|
@ -1637,9 +1637,8 @@ impl<T: IndexValue> AccountsIndex<T> {
|
|||
}
|
||||
|
||||
pub fn unref_from_storage(&self, pubkey: &Pubkey) {
|
||||
if let Some(locked_entry) = self.get_account_read_entry(pubkey) {
|
||||
locked_entry.unref();
|
||||
}
|
||||
let map = &self.account_maps[self.bin_calculator.bin_from_pubkey(pubkey)];
|
||||
map.read().unwrap().unref(pubkey)
|
||||
}
|
||||
|
||||
pub fn ref_count_from_storage(&self, pubkey: &Pubkey) -> RefCount {
|
||||
|
|
|
@ -290,6 +290,10 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn unref(&self, pubkey: &Pubkey) {
|
||||
self.get_internal(pubkey, |entry| entry.map(|entry| entry.add_un_ref(false)));
|
||||
}
|
||||
|
||||
pub fn upsert(
|
||||
&self,
|
||||
pubkey: &Pubkey,
|
||||
|
|
Loading…
Reference in New Issue