pub struct GarbageCollector { /* private fields */ }Expand description
Shape VM Garbage Collector
Without gc feature: stub (all operations are no-ops, Arc handles memory).
With gc feature: tracks stats from GcHeap collections.
Implementations§
Source§impl GarbageCollector
impl GarbageCollector
pub fn new(config: GCConfig) -> Self
pub fn config(&self) -> &GCConfig
pub fn add_root(&self, _obj_id: ObjectId)
pub fn remove_root(&self, _obj_id: ObjectId)
pub fn collect(&self) -> GCResult
Sourcepub fn collect_incremental(&self)
pub fn collect_incremental(&self)
Incremental collection step (no-op in this stub).
When the gc feature is enabled, incremental marking is driven by
gc_heap.collect_incremental() in gc_integration.rs – this stub
is not called in that path. It exists for API compatibility when
the gc feature is disabled (Arc refcounting handles memory).
pub fn force_collect(&self) -> GCResult
pub fn heap_size(&self) -> usize
pub fn object_count(&self) -> usize
pub fn stats(&self) -> GCStats
pub fn contains_object(&self, _obj_id: ObjectId) -> bool
Sourcepub fn record_collection(&self, result: &GCResult)
pub fn record_collection(&self, result: &GCResult)
Record a collection in the stats (used by GC integration).
Auto Trait Implementations§
impl !Freeze for GarbageCollector
impl !RefUnwindSafe for GarbageCollector
impl Send for GarbageCollector
impl !Sync for GarbageCollector
impl Unpin for GarbageCollector
impl UnsafeUnpin 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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