Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Only dirty when count==0?
Browse files Browse the repository at this point in the history
  • Loading branch information
sakridge committed Jun 14, 2021
1 parent 234df47 commit ddcd41a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2203,6 +2203,8 @@ impl AccountsDb {
if let Some(slot_stores) = self.storage.get_slot_stores(slot) {
slot_stores.write().unwrap().retain(|_key, store| {
if store.count() == 0 {
self.dirty_stores
.insert((slot, store.append_vec_id()), store.clone());
dead_storages.push(store.clone());
false
} else {
Expand Down Expand Up @@ -5059,9 +5061,9 @@ impl AccountsDb {
store.slot(), *slot
);
let count = store.remove_account(account_info.stored_size, reset_accounts);
self.dirty_stores
.insert((*slot, store.append_vec_id()), store.clone());
if count == 0 {
self.dirty_stores
.insert((*slot, store.append_vec_id()), store.clone());
dead_slots.insert(*slot);
} else if self.caching_enabled
&& Self::is_shrinking_productive(*slot, &[store.clone()])
Expand Down

0 comments on commit ddcd41a

Please sign in to comment.