pub struct Generation {
pub number: usize,
/* private fields */
}Expand description
Represents a single generation in the generational heap
Fields§
§number: usizeGeneration number (0 = youngest)
Implementations§
Source§impl Generation
impl Generation
pub fn new(number: usize, max_size: usize, promotion_threshold: usize) -> Self
Sourcepub fn current_size(&self) -> usize
pub fn current_size(&self) -> usize
Get current size
Sourcepub fn utilization(&self) -> f64
pub fn utilization(&self) -> f64
Get utilization as a percentage
Sourcepub fn deallocate(&self, size: usize)
pub fn deallocate(&self, size: usize)
Deallocate bytes from this generation
Sourcepub fn record_collection(&self, objects_collected: usize, survivors: usize)
pub fn record_collection(&self, objects_collected: usize, survivors: usize)
Record a collection in this generation
Sourcepub fn collection_count(&self) -> usize
pub fn collection_count(&self) -> usize
Get collection count
Sourcepub fn survivor_count(&self) -> usize
pub fn survivor_count(&self) -> usize
Get survivor count from last collection
Sourcepub fn should_promote(&self, object_age: usize) -> bool
pub fn should_promote(&self, object_age: usize) -> bool
Check if objects should be promoted based on survival count
Sourcepub fn time_since_last_collection(&self) -> Option<Duration>
pub fn time_since_last_collection(&self) -> Option<Duration>
Get time since last collection
Sourcepub fn collection_frequency(&self) -> f64
pub fn collection_frequency(&self) -> f64
Get collection frequency (collections per minute)
Sourcepub fn stats(&self) -> GenerationStats
pub fn stats(&self) -> GenerationStats
Get generation statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Generation
impl !RefUnwindSafe for Generation
impl Send for Generation
impl Sync for Generation
impl Unpin for Generation
impl UnwindSafe for Generation
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