[Rcpp-devel] Problem passing Armadillo objects back to R

Romain Francois romain at r-enthusiasts.com
Thu Apr 7 10:03:10 CEST 2011


Le 07/04/11 05:07, Christian Gunning a écrit :
>> The issue is that when calling wrap it creates an unprotected SEXP, and
>> Rcpp is not responsible for these. If the programmer passes an
>> unprotected SEXP to ::create, it is his responsability to protect it.
>
> Just to clarify -- in the case of a naive user who's not protecting
> objects: a single wrap as the last call in a function is one case that
> will *always* work as expected, correct?

I think you are right.

> And when using more than one
> wrap, later ones can *potentially* but not necessarily clobber earlier
> ones, yes?

This is what makes it difficult to detect. You never know when garbage 
is being collected.

> thanks,
> -christian
>
>


-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
http://romain-francois.com
|- http://bit.ly/fhqbRC : Rcpp workshop in Chicago on April 28th
|- http://bit.ly/dFyZGB : Hydraulique au Montpellier Comedie Club
`- http://bit.ly/eVXit9 : Eponyme : 40 minutes stand up




More information about the Rcpp-devel mailing list