Struct zerogc_context::CollectorContext [−][src]
pub struct CollectorContext<C: RawCollectorImpl> { /* fields omitted */ }
Implementations
Trait Implementations
type System = CollectorRef<C>
type System = CollectorRef<C>
The system used with this context
type Id = CollectorId<C>
type Id = CollectorId<C>
The type of ids used in the system
Potentially perform a garbage collection, freeing all objects that aren’t reachable from the specified root. Read more
Inform the garbage collection system we are at a safepoint and are ready for a potential garbage collection. Read more
Potentially perform a garbage collection, freeing all objects that aren’t reachable from the specified root. Read more
Rebrand to the specified root so that it
lives for the 'static
lifetime. Read more
Allocate room for a object in, but don’t finish initializing it. Read more
Allocate a slice with the specified length, whose memory is uninitialized Read more
fn alloc_vec_with_capacity<'gc, T>(
&'gc self,
capacity: usize
) -> GcVec<'gc, T, Self> where
T: GcSafe + 'gc,
fn alloc_vec_with_capacity<'gc, T>(
&'gc self,
capacity: usize
) -> GcVec<'gc, T, Self> where
T: GcSafe + 'gc,
Allocate the specified object in this garbage collector, binding it to the lifetime of this collector. Read more
Allocate a slice, copied from the specified input
Allocate a slice by filling it with results from the specified closure. Read more
Allocate a slice of the specified length,
initializing everything to None
Read more
It’s not safe for a context to be sent across threads.
We use (thread-unsafe) interior mutability to maintain the
shadow stack. Since we could potentially be cloned via safepoint_recurse!
,
implementing Send
would allow another thread to obtain a
reference to our internal &RefCell
. Further mutation/access
would be undefined…..