Skip to content

Commit

Permalink
add comment (#2775)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Aug 28, 2024
1 parent e8cc9dc commit 184469c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,7 @@ impl AccountStorageEntry {
}
}

/// returns # of accounts remaining in the storage
fn remove_accounts(
&self,
num_bytes: usize,
Expand Down Expand Up @@ -8030,11 +8031,13 @@ impl AccountsDb {
store.slot(), *slot
);
if offsets.len() == store.count() {
// all remaining alive accounts in the storage are being removed, so the entire storage/slot is dead
store.remove_accounts(store.alive_bytes(), reset_accounts, offsets.len());
self.dirty_stores.insert(*slot, store.clone());
dead_slots.insert(*slot);
}
else {
// not all accounts are being removed, so figure out sizes of accounts we are removing and update the alive bytes and alive account count
let (_, us) = measure_us!({
let mut offsets = offsets.iter().cloned().collect::<Vec<_>>();
// sort so offsets are in order. This improves efficiency of loading the accounts.
Expand Down

0 comments on commit 184469c

Please sign in to comment.