[−][src]Macro zerogc::safepoint
Indicate it's safe to begin a garbage collection, while keeping the specified root alive.
All other garbage collected pointers that aren't reachable from the root are invalidated. They have a lifetime that references the [GcRef] and the borrow checker considers the safepoint a 'mutation'.
The root is exempted from the "mutation" and rebound to the new lifetime.
Example
let root = safepoint!(collector, root);
Safety
This macro is completely safe, although it expands to unsafe code internally.