From 5591cd6ef3183fd58872e71d876103a217d3aeb9 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Fri, 23 Apr 2021 09:35:09 -0500 Subject: [PATCH] .owner -> .owner() (#16757) * .owner -> .get_owner() * use --- runtime/benches/accounts.rs | 16 +++--- runtime/src/accounts.rs | 8 +-- runtime/src/accounts_db.rs | 86 ++++++++++++++--------------- runtime/src/serde_snapshot/tests.rs | 4 +- 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/runtime/benches/accounts.rs b/runtime/benches/accounts.rs index 4de868c472..fa7e579ff9 100644 --- a/runtime/benches/accounts.rs +++ b/runtime/benches/accounts.rs @@ -12,7 +12,7 @@ use solana_runtime::{ bank::*, }; use solana_sdk::{ - account::AccountSharedData, + account::{AccountSharedData, ReadableAccount}, genesis_config::{create_genesis_config, ClusterType}, hash::Hash, pubkey::Pubkey, @@ -29,7 +29,7 @@ fn deposit_many(bank: &Bank, pubkeys: &mut Vec, num: usize) { for t in 0..num { let pubkey = solana_sdk::pubkey::new_rand(); let account = - AccountSharedData::new((t + 1) as u64, 0, &AccountSharedData::default().owner); + AccountSharedData::new((t + 1) as u64, 0, AccountSharedData::default().owner()); pubkeys.push(pubkey); assert!(bank.get_account(&pubkey).is_none()); bank.deposit(&pubkey, (t + 1) as u64); @@ -153,11 +153,11 @@ fn bench_delete_dependencies(bencher: &mut Bencher) { false, ); let mut old_pubkey = Pubkey::default(); - let zero_account = AccountSharedData::new(0, 0, &AccountSharedData::default().owner); + let zero_account = AccountSharedData::new(0, 0, AccountSharedData::default().owner()); for i in 0..1000 { let pubkey = solana_sdk::pubkey::new_rand(); let account = - AccountSharedData::new((i + 1) as u64, 0, &AccountSharedData::default().owner); + AccountSharedData::new((i + 1) as u64, 0, AccountSharedData::default().owner()); accounts.store_slow_uncached(i, &pubkey, &account); accounts.store_slow_uncached(i, &old_pubkey, &zero_account); old_pubkey = pubkey; @@ -192,7 +192,7 @@ fn store_accounts_with_possible_contention( (0..num_keys) .map(|_| { let pubkey = solana_sdk::pubkey::new_rand(); - let account = AccountSharedData::new(1, 0, &AccountSharedData::default().owner); + let account = AccountSharedData::new(1, 0, AccountSharedData::default().owner()); accounts.store_slow_uncached(slot, &pubkey, &account); pubkey }) @@ -212,7 +212,7 @@ fn store_accounts_with_possible_contention( let num_new_keys = 1000; let new_accounts: Vec<_> = (0..num_new_keys) - .map(|_| AccountSharedData::new(1, 0, &AccountSharedData::default().owner)) + .map(|_| AccountSharedData::new(1, 0, AccountSharedData::default().owner())) .collect(); bencher.iter(|| { for account in &new_accounts { @@ -249,7 +249,7 @@ fn bench_concurrent_read_write(bencher: &mut Bencher) { fn bench_concurrent_scan_write(bencher: &mut Bencher) { store_accounts_with_possible_contention("concurrent_scan_write", bencher, |accounts, _| loop { test::black_box( - accounts.load_by_program(&Ancestors::default(), &AccountSharedData::default().owner), + accounts.load_by_program(&Ancestors::default(), AccountSharedData::default().owner()), ); }) } @@ -323,7 +323,7 @@ fn setup_bench_dashmap_iter() -> (Arc, DashMap