[−][src]Trait zerogc::CollectorId
Uniquely identifies the collector in case there are multiple collectors.
Safety
To simply the typing, this contains no references to the lifetime of the associated GcSystem.
It's implicitly held and is unsafe to access. As long as the collector is valid, this id should be too.
It should be safe to assume that a collector exists if any of its pointers still do!
Associated Types
Loading content...Required methods
pub unsafe fn gc_write_barrier<'gc, T: GcSafe + ?Sized + 'gc, V: GcSafe + ?Sized + 'gc>(
owner: &Gc<'gc, T, Self>,
value: &Gc<'gc, V, Self>,
field_offset: usize
)
[src]
owner: &Gc<'gc, T, Self>,
value: &Gc<'gc, V, Self>,
field_offset: usize
)
Perform a write barrier before writing to a garbage collected field
Safety
Smilar to the GcDirectBarrier trait, it can be assumed that the field offset is correct and the types match.
pub unsafe fn assume_valid_system(&self) -> &Self::System
[src]
Assume the ID is valid and use it to access the GcSystem
NOTE: The system is bound to the lifetime of THIS id. A CollectorId may have an internal pointer to the system and the pointer may not have a stable address. In other words, it may be difficult to reliably take a pointer to a pointer.
Safety
Undefined behavior if the associated collector no longer exists.