Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarg66 committed May 10, 2023
1 parent 25ff300 commit 5521825
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ impl LoadedPrograms {
}
}

pub fn unload_program(&mut self, id: &Pubkey) {
fn unload_program(&mut self, id: &Pubkey) {
if let Some(entries) = self.entries.get_mut(id) {
entries.iter_mut().for_each(|entry| {
if entry.is_loaded() {
Expand Down
6 changes: 3 additions & 3 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4053,11 +4053,11 @@ impl Bank {
}

/// Unload a program from the bank's cache
fn unload_program(&self, pubkey: &Pubkey) {
fn remove_program_from_cache(&self, pubkey: &Pubkey) {
self.loaded_programs_cache
.write()
.unwrap()
.unload_program(pubkey);
.remove_programs([*pubkey].into_iter());
}

fn program_modification_slot(&self, pubkey: &Pubkey) -> Result<Slot> {
Expand Down Expand Up @@ -7577,7 +7577,7 @@ impl Bank {
// Clear new account
self.store_account(new_address, &AccountSharedData::default());

self.unload_program(old_address);
self.remove_program_from_cache(old_address);

self.calculate_and_update_accounts_data_size_delta_off_chain(
old_account.data().len(),
Expand Down

0 comments on commit 5521825

Please sign in to comment.