pub unsafe fn Rf_protect(s: SEXP) -> SEXPExpand description
Add a SEXP to the protect stack, preventing GC collection.
Cost: O(1) — single array write (R_PPStack[top++] = s). No allocation.
Must be balanced by a corresponding Rf_unprotect. The protect stack is
LIFO — nested scopes are safe, but interleaved usage from different scopes
will cause incorrect unprotection.
Checked wrapper for Rf_protect. Calls Rf_protect_unchecked and routes through with_r_thread.
Generated from source location line 2087, column 12.
Generated from source file miniextendr-api/src/ffi.rs.