add `is_recyclable` to `AccountsFile` (#31257)
This commit is contained in:
parent
9124d1f35d
commit
318f981274
|
@ -5551,7 +5551,10 @@ impl AccountsDb {
|
|||
min = std::cmp::min(store.accounts.capacity(), min);
|
||||
avail += 1;
|
||||
|
||||
if store.accounts.capacity() >= min_size && store.accounts.capacity() < max_size {
|
||||
if store.accounts.is_recyclable()
|
||||
&& store.accounts.capacity() >= min_size
|
||||
&& store.accounts.capacity() < max_size
|
||||
{
|
||||
let ret = recycle_stores.remove_entry(i);
|
||||
drop(recycle_stores);
|
||||
let old_id = ret.append_vec_id();
|
||||
|
|
|
@ -86,6 +86,12 @@ impl AccountsFile {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn is_recyclable(&self) -> bool {
|
||||
match self {
|
||||
Self::AppendVec(_) => true,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn file_name(slot: Slot, id: impl std::fmt::Display) -> String {
|
||||
format!("{slot}.{id}")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue