Startup optimization in shrink - don't shrink non-shrinkable slots (backport #17405) (#17792)

* Skip shrink when it doesn't save anything (#17405)

(cherry picked from commit 14c52ab018)

# Conflicts:
#	runtime/src/accounts_db.rs

* fix merge error

Co-authored-by: sakridge <sakridge@gmail.com>
Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
This commit is contained in:
mergify[bot]
2021-06-16 23:28:03 +00:00
committed by GitHub
parent 2f0f1fd5f5
commit 30bbc1350d
2 changed files with 151 additions and 56 deletions

View File

@@ -146,6 +146,10 @@ impl<T: Clone> ReadAccountMapEntry<T> {
pub fn unref(&self) {
self.ref_count().fetch_sub(1, Ordering::Relaxed);
}
pub fn addref(&self) {
self.ref_count().fetch_add(1, Ordering::Relaxed);
}
}
#[self_referencing]