Add limit and shrink policy for recycler (#15320)

This commit is contained in:
carllin
2021-02-24 00:15:58 -08:00
committed by GitHub
parent 2f46da346d
commit c2e8814dce
24 changed files with 515 additions and 127 deletions

View File

@@ -76,6 +76,9 @@ impl<T: Default + Clone + Sized> Reset for PinnedVec<T> {
fn set_recycler(&mut self, recycler: Weak<RecyclerX<Self>>) {
self.recycler = Some(recycler);
}
fn unset_recycler(&mut self) {
self.recycler = None;
}
}
impl<T: Clone + Default + Sized> Default for PinnedVec<T> {