Skip to main content

needs_root

Function needs_root 

Source
fn needs_root(value: SEXP) -> bool
Expand description

Whether value needs a GC root while Rust holds it across an allocation.

A symbol never does: R never frees one. install() links every new symbol into R_SymbolTable (src/main/names.c, install, and installNoTrChar likewise), nothing ever unlinks it, and the collector marks every bucket of the table on every collection (src/main/memory.c, RunGenCollect: the R_SymbolTable loop). The marker symbols outside the table (R_MissingArg, R_UnboundValue, R_RestartToken and the rest, made by mkSymMarker in InitNames) are forwarded as roots of their own in the same function.