[Rcpp-devel] Debugging intermittant vignette re-building failure

Dirk Eddelbuettel edd at debian.org
Thu Jan 10 02:06:08 CET 2019


On 10 January 2019 at 00:23, Fellows, Ian wrote:
| My understanding is that afunc safe to use in a module. Is it also safe to call from other C++ code, or is lis open to garbage collection?

Every SEXP contains memory owned by R -- we create them that way and when we
return them to R they are indistinguishable. They really are R objects. [
Also note the caveat that SEXPs are just SEXPs -- no reference
counting. RObject is better, Rcpp::Shield<SEXP> is a more modern variant ]

Hence when you want to share in the C++ side, STL containers may be preferable.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list