pub struct GarbageCollectionEngine { /* private fields */ }Expand description
Main garbage collection engine
Implementations§
Source§impl GarbageCollectionEngine
impl GarbageCollectionEngine
pub fn new(config: GCConfig) -> Self
Sourcepub fn register_region(
&mut self,
base_addr: usize,
size: usize,
generation: u32,
)
pub fn register_region( &mut self, base_addr: usize, size: usize, generation: u32, )
Register a memory region for GC management
Sourcepub fn track_object(
&mut self,
region_addr: usize,
obj_addr: usize,
size: usize,
type_id: u32,
) -> Result<(), GCError>
pub fn track_object( &mut self, region_addr: usize, obj_addr: usize, size: usize, type_id: u32, ) -> Result<(), GCError>
Add object to GC tracking
Sourcepub fn should_collect(&mut self) -> bool
pub fn should_collect(&mut self) -> bool
Check if GC should be triggered
Sourcepub fn get_performance_history(&self) -> &VecDeque<GCPerformance>
pub fn get_performance_history(&self) -> &VecDeque<GCPerformance>
Get performance history
Sourcepub fn get_collector_info(&self) -> Vec<(String, GCCollectorStats)>
pub fn get_collector_info(&self) -> Vec<(String, GCCollectorStats)>
Get collector information
Sourcepub fn force_collect_region(
&mut self,
region_addr: usize,
) -> Result<GCResult, GCError>
pub fn force_collect_region( &mut self, region_addr: usize, ) -> Result<GCResult, GCError>
Force collection on specific region
Sourcepub fn add_reference(&mut self, from: usize, to: usize)
pub fn add_reference(&mut self, from: usize, to: usize)
Add reference between objects
Sourcepub fn remove_reference(&mut self, from: usize, to: usize)
pub fn remove_reference(&mut self, from: usize, to: usize)
Remove reference between objects
Sourcepub fn add_root_reference(&mut self, obj: usize)
pub fn add_root_reference(&mut self, obj: usize)
Add root reference
Sourcepub fn remove_root_reference(&mut self, obj: usize)
pub fn remove_root_reference(&mut self, obj: usize)
Remove root reference
Auto Trait Implementations§
impl Freeze for GarbageCollectionEngine
impl !RefUnwindSafe for GarbageCollectionEngine
impl Send for GarbageCollectionEngine
impl Sync for GarbageCollectionEngine
impl Unpin for GarbageCollectionEngine
impl UnsafeUnpin for GarbageCollectionEngine
impl !UnwindSafe for GarbageCollectionEngine
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