Trait mmtk::vm::ObjectTracer

source ·
pub trait ObjectTracer {
    // Required method
    fn trace_object(&mut self, object: ObjectReference) -> ObjectReference;
}
Expand description

Callback trait of scanning functions that directly trace through object graph edges.

Required Methods§

source

fn trace_object(&mut self, object: ObjectReference) -> ObjectReference

Call this function to trace through an object graph edge which points to object.

The return value is the new object reference for object if it is moved, or object if not moved. If moved, the caller should update the slot that holds the reference to object so that it points to the new location.

Note: This function is performance-critical, therefore must be implemented efficiently.

Implementors§

source§

impl<E: ProcessEdgesWork> ObjectTracer for ProcessEdgesWorkTracer<E>

source§

impl<F: FnMut(ObjectReference) -> ObjectReference> ObjectTracer for F

This lets us use closures as ObjectTracer.