Trait zerogc_context::collector::RawCollectorImpl [−][src]
pub unsafe trait RawCollectorImpl: 'static + Sized { type DynTracePtr: Copy + Debug + 'static; type Config: Sized + Default; type Ptr: CollectorPtr<Self>; type Manager: CollectionManager<Self, Context = Self::RawContext>; type RawContext: RawContext<Self>; type RawVecRepr: GcVecRepr; const SINGLETON: bool; const SYNC: bool; fn id_for_gc<'a, 'gc, T: ?Sized>(
gc: &'a Gc<'gc, T, CollectorId<Self>>
) -> &'a CollectorId<Self>
where
'gc: 'a,
T: GcSafe + ?Sized + 'gc; fn id_for_array<'a, 'gc, T>(
gc: &'a GcArray<'gc, T, CollectorId<Self>>
) -> &'a CollectorId<Self>
where
'gc: 'a,
T: GcSafe + 'gc; fn resolve_array_len<'gc, T>(
gc: GcArray<'gc, T, CollectorId<Self>>
) -> usize
where
T: GcSafe + 'gc; unsafe fn as_dyn_trace_pointer<T: Trace>(t: *mut T) -> Self::DynTracePtr; fn init(config: Self::Config, logger: Logger) -> NonNull<Self>; unsafe fn gc_write_barrier<'gc, O: ?Sized, V: ?Sized>(
owner: &Gc<'gc, O, CollectorId<Self>>,
value: &Gc<'gc, V, CollectorId<Self>>,
field_offset: usize
)
where
O: GcSafe + ?Sized + 'gc,
V: GcSafe + ?Sized + 'gc; fn logger(&self) -> &Logger; fn manager(&self) -> &Self::Manager; fn should_collect(&self) -> bool; fn allocated_size(&self) -> MemorySize; unsafe fn perform_raw_collection(&self, contexts: &[*mut Self::RawContext]); fn id(&self) -> CollectorId<Self> { ... } }
Expand description
A specific implementation of a collector
Associated Types
type DynTracePtr: Copy + Debug + 'static
type DynTracePtr: Copy + Debug + 'static
A dynamic pointer to a Trace
root
The simple collector implements this as a trait object pointer.
type Ptr: CollectorPtr<Self>
type Ptr: CollectorPtr<Self>
A pointer to this collector
Must be a ZST if the collector is a singleton.
type Manager: CollectionManager<Self, Context = Self::RawContext>
type Manager: CollectionManager<Self, Context = Self::RawContext>
The type that manages this collector’s state
type RawContext: RawContext<Self>
type RawContext: RawContext<Self>
The context
type RawVecRepr: GcVecRepr
type RawVecRepr: GcVecRepr
The raw representation of a vec
Associated Constants
True if this collector is a singleton
If the collector allows multiple instances, this must be false
Required methods
fn id_for_gc<'a, 'gc, T: ?Sized>(
gc: &'a Gc<'gc, T, CollectorId<Self>>
) -> &'a CollectorId<Self> where
'gc: 'a,
T: GcSafe + ?Sized + 'gc,
fn id_for_array<'a, 'gc, T>(
gc: &'a GcArray<'gc, T, CollectorId<Self>>
) -> &'a CollectorId<Self> where
'gc: 'a,
T: GcSafe + 'gc,
fn resolve_array_len<'gc, T>(gc: GcArray<'gc, T, CollectorId<Self>>) -> usize where
T: GcSafe + 'gc,
unsafe fn as_dyn_trace_pointer<T: Trace>(t: *mut T) -> Self::DynTracePtr
unsafe fn as_dyn_trace_pointer<T: Trace>(t: *mut T) -> Self::DynTracePtr
Convert the specified value into a dyn pointer
Initialize an instance of the collector
Must panic if the collector is not a singleton
unsafe fn gc_write_barrier<'gc, O: ?Sized, V: ?Sized>(
owner: &Gc<'gc, O, CollectorId<Self>>,
value: &Gc<'gc, V, CollectorId<Self>>,
field_offset: usize
) where
O: GcSafe + ?Sized + 'gc,
V: GcSafe + ?Sized + 'gc,
fn should_collect(&self) -> bool
fn allocated_size(&self) -> MemorySize
unsafe fn perform_raw_collection(&self, contexts: &[*mut Self::RawContext])
Provided methods
fn id(&self) -> CollectorId<Self>
fn id(&self) -> CollectorId<Self>
The id of this collector