pub struct GcGeneration { /* private fields */ }Expand description
One generation’s collection policy and statistics, per interpreter.
The objects themselves live in the process-wide lists on GcState, so the
occupancy count sits there; what an interpreter owns is when to collect and
what its own collections have done.
Implementations§
Source§impl GcGeneration
impl GcGeneration
pub const fn new(threshold: u32) -> Self
Sourcepub fn threshold(&self) -> u32
pub fn threshold(&self) -> u32
Relaxed: this is policy read once per allocation, and a collection
racing gc.set_threshold() may use either value.
pub fn set_threshold(&self, value: u32)
pub fn stats(&self) -> GcStats
pub fn update_stats( &self, collected: usize, uncollectable: usize, candidates: usize, duration: f64, )
Auto Trait Implementations§
impl !Freeze for GcGeneration
impl !RefUnwindSafe for GcGeneration
impl !Sync for GcGeneration
impl Send for GcGeneration
impl Unpin for GcGeneration
impl UnsafeUnpin for GcGeneration
impl UnwindSafe for GcGeneration
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Helper for T
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
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