[][src]Macro zerogc::__recurse_context

macro_rules! __recurse_context {
    ($context:ident, $root:expr, |$sub_context:ident, $new_root:ident| $closure:expr) => { ... };
}

Create a new sub-context for the duration of the closure

The specified root object will be appended to the shadowstack and is guarenteed to live for the entire lifetime of the closure (and the created sub-context).

Unlike safepoint_recurse! this doesn't imply a safepoint anywhere.

Safety

This doesn't actually mutate the original collector. It is possible user code could trigger a collection in the closure without the borrow checker noticing invalid pointers elsewhere. (See docs for GcContext::recurse_context)

It is not publicly exposed for this reason