Trait zerogc_context::state::RawContext[][src]

pub unsafe trait RawContext<C>: Debug + Sealed where
    C: RawCollectorImpl<RawContext = Self>, 
{ unsafe fn register_new(
        collector: &CollectorRef<C>
    ) -> ManuallyDrop<Box<Self>>;
unsafe fn trigger_safepoint(&self);
fn shadow_stack_ptr(&self) -> *mut ShadowStack<C>;
unsafe fn collector(&self) -> &C;
fn state(&self) -> ContextState; unsafe fn assume_valid_shadow_stack(&self) -> &ShadowStack<C> { ... } }
Expand description

The underlying state of a context

Each context is bound to one and only one thread, even if the collector supports multi-threading.

Required methods

unsafe fn register_new(collector: &CollectorRef<C>) -> ManuallyDrop<Box<Self>>[src]

unsafe fn trigger_safepoint(&self)[src]

Expand description

Trigger a safepoint for this context.

This implicitly attempts a collection, potentially blocking until completion..

Undefined behavior if mutated during collection

fn shadow_stack_ptr(&self) -> *mut ShadowStack<C>[src]

Expand description

Get a pointer to the shadow stack

unsafe fn collector(&self) -> &C[src]

Expand description

Get a reference to the collector, assuming that it’s valid

fn state(&self) -> ContextState[src]

Provided methods

unsafe fn assume_valid_shadow_stack(&self) -> &ShadowStack<C>[src]

Expand description

Borrow a reference to the shadow stack, assuming this context is valid (not active).

A context is valid if it is either frozen or paused at a safepoint.

Implementors

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

unsafe fn register_new(collector: &CollectorRef<C>) -> ManuallyDrop<Box<Self>>[src]

unsafe fn trigger_safepoint(&self)[src]

fn shadow_stack_ptr(&self) -> *mut ShadowStack<C>[src]

unsafe fn collector(&self) -> &C[src]

fn state(&self) -> ContextState[src]

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

unsafe fn register_new(collector: &CollectorRef<C>) -> ManuallyDrop<Box<Self>>[src]

unsafe fn trigger_safepoint(&self)[src]

fn shadow_stack_ptr(&self) -> *mut ShadowStack<C>[src]

unsafe fn collector(&self) -> &C[src]

fn state(&self) -> ContextState[src]