How to protect a SEXP beyond the duration of .Call ? Need to prevent GC from cleaning callback functions only referred to by a C struct...
1
R_PreserveObject + R_ReleaseObject?
2
2
perfect!! Was searching Rinternals.h for 'protect' instead of 'preserve'...
1
Replying to @opencpu
And if you were using Rcpp it would happen automagically for you @opencpu @kevin_ushey #rstats #rcpp

Jun 6, 2016 · 8:18 PM UTC

1
are you sure about this? How would Rcpp know that I stored a pointer to a SEXP somewhere?
2