[][src]Trait zerogc_context::state::CollectionManager

pub unsafe trait CollectionManager<C>: Sealed where
    C: RawCollectorImpl<Manager = Self, RawContext = Self::Context>, 
{ type Context: RawContext<C>; pub fn new() -> Self;
pub fn is_collecting(&self) -> bool;
pub fn should_trigger_collection(&self) -> bool;
pub unsafe fn freeze_context(&self, context: &Self::Context);
pub unsafe fn unfreeze_context(&self, context: &Self::Context);
pub fn prevent_collection<R>(collector: &C, func: impl FnOnce() -> R) -> R;
pub unsafe fn free_context(collector: &C, context: *mut Self::Context); }

Manages coordination of garbage collections

Associated Types

Loading content...

Required methods

pub fn new() -> Self[src]

pub fn is_collecting(&self) -> bool[src]

pub fn should_trigger_collection(&self) -> bool[src]

pub unsafe fn freeze_context(&self, context: &Self::Context)[src]

pub unsafe fn unfreeze_context(&self, context: &Self::Context)[src]

pub fn prevent_collection<R>(collector: &C, func: impl FnOnce() -> R) -> R[src]

Attempt to prevent garbage collection for the duration of the closure

This method is OPTIONAL and will panic if unimplemented.

pub unsafe fn free_context(collector: &C, context: *mut Self::Context)[src]

Free the specified context

Safety

  • Assumes the specified pointer is valid
  • Assumes there are no more outstanding borrows to values in the context
Loading content...

Implementors

impl<C> CollectionManager<C> for zerogc_context::state::nosync::CollectionManager<C> where
    C: RawCollectorImpl<Manager = Self, RawContext = RawContext<C>>, 
[src]

type Context = RawContext<C>

impl<C> CollectionManager<C> for zerogc_context::state::sync::CollectionManager<C> where
    C: SyncCollector,
    C: RawCollectorImpl<Manager = Self, RawContext = RawContext<C>>, 
[src]

type Context = RawContext<C>

Loading content...