pub struct GarbageCollector {
alive: FxHashSet<usize>,
storages: Vec<&'static (dyn Storage + Send + Sync)>,
}Fields§
§alive: FxHashSet<usize>§storages: Vec<&'static (dyn Storage + Send + Sync)>Implementations§
Source§impl GarbageCollector
impl GarbageCollector
pub fn add_storage<T: Internable + GcInternedVisit>(&mut self)
pub fn add_slice_storage<T: SliceInternable + GcInternedSliceVisit>(&mut self)
Sourcepub unsafe fn collect(self)
pub unsafe fn collect(self)
§Safety
- This cannot be called if there are some not-yet-recorded type values.
- All relevant storages must have been added; that is, within the full graph of values, the added storages must form a DAG.
GcInternedVisitandGcInternedSliceVisitmust mark all values reachable from the node.
pub fn mark_interned_alive<T: Internable>( &mut self, interned: InternedRef<'_, T>, ) -> ControlFlow<()>
pub fn mark_interned_slice_alive<T: SliceInternable>( &mut self, interned: InternedSliceRef<'_, T>, ) -> ControlFlow<()>
fn sweep_storage<T: Hash + Eq + Send + Sync>( &self, storage: &DashMap<T, (), FxBuildHasher>, get_addr: impl Fn(&T) -> usize + Send + Sync, )
fn retain_only_alive<T>( &self, map: &mut RawTable<T>, get_addr: impl FnMut(&T) -> usize, )
Trait Implementations§
Source§impl Default for GarbageCollector
impl Default for GarbageCollector
Source§fn default() -> GarbageCollector
fn default() -> GarbageCollector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GarbageCollector
impl !RefUnwindSafe for GarbageCollector
impl Send for GarbageCollector
impl Sync for GarbageCollector
impl Unpin for GarbageCollector
impl !UnwindSafe for GarbageCollector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more