[Rcpp-devel] Possible unprotected memory problems

Dirk Eddelbuettel edd at debian.org
Fri Jul 22 19:53:19 CEST 2011


On 21 July 2011 at 14:02, Dirk Eddelbuettel wrote:
| On 21 July 2011 at 14:15, Steve Lianoglou wrote:
| | In theory, I guess it would be like having an unbalanced
| | PROTECT/UNPROTECT going on.
| 
| We don't do PROTECT / UNPROTECT but a bit gets set that corresponds to the
| same. I would have to look up the details as it has been a while....

For completeness:  RObject.h has these private methods:

    void preserve(){ if( m_sexp != R_NilValue ) R_PreserveObject(m_sexp) ; }
    void release() { if( m_sexp != R_NilValue ) R_ReleaseObject(m_sexp) ; } 

So if one wanted to mess with this (Hi, Steve! :-) these are (base R)
function to use.

Dirk

-- 
Gauss once played himself in a zero-sum game and won $50.
                      -- #11 at http://www.gaussfacts.com


More information about the Rcpp-devel mailing list