[Rcpp-commits] r2812 - in pkg/Rcpp: inst/include inst/include/Rcpp inst/include/Rcpp/traits src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Dec 22 13:37:31 CET 2010
Author: romain
Date: 2010-12-22 13:37:31 +0100 (Wed, 22 Dec 2010)
New Revision: 2812
Modified:
pkg/Rcpp/inst/include/Rcpp/RObject.h
pkg/Rcpp/inst/include/Rcpp/traits/Exporter.h
pkg/Rcpp/inst/include/RcppCommon.h
pkg/Rcpp/src/cache.cpp
Log:
Rcpp_PreserveObject and Rcpp_ReleaseObject aliases
Modified: pkg/Rcpp/inst/include/Rcpp/RObject.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/RObject.h 2010-12-22 12:29:57 UTC (rev 2811)
+++ pkg/Rcpp/inst/include/Rcpp/RObject.h 2010-12-22 12:37:31 UTC (rev 2812)
@@ -265,8 +265,8 @@
private:
- void preserve(){ if( m_sexp != R_NilValue ) R_PreserveObject(m_sexp) ; }
- void release() { if( m_sexp != R_NilValue ) R_ReleaseObject(m_sexp) ; }
+ void preserve(){ if( m_sexp != R_NilValue ) Rcpp_PreserveObject(m_sexp) ; }
+ void release() { if( m_sexp != R_NilValue ) Rcpp_ReleaseObject(m_sexp) ; }
virtual void update() {
RCPP_DEBUG_1( "RObject::update(SEXP = <%p> )", m_sexp ) ;
} ;
Modified: pkg/Rcpp/inst/include/Rcpp/traits/Exporter.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/Exporter.h 2010-12-22 12:29:57 UTC (rev 2811)
+++ pkg/Rcpp/inst/include/Rcpp/traits/Exporter.h 2010-12-22 12:37:31 UTC (rev 2812)
@@ -39,12 +39,8 @@
public:
typedef typename T::value_type r_export_type ;
- RangeExporter( SEXP x ) : object(x){
- // R_PreserveObject(object) ;
- }
- ~RangeExporter(){
- // R_ReleaseObject(object) ;
- }
+ RangeExporter( SEXP x ) : object(x){}
+ ~RangeExporter(){}
T get(){
T vec( ::Rf_length(object) );
Modified: pkg/Rcpp/inst/include/RcppCommon.h
===================================================================
--- pkg/Rcpp/inst/include/RcppCommon.h 2010-12-22 12:29:57 UTC (rev 2811)
+++ pkg/Rcpp/inst/include/RcppCommon.h 2010-12-22 12:37:31 UTC (rev 2812)
@@ -132,6 +132,9 @@
#include <Rcpp/complex.h>
+void Rcpp_PreserveObject( SEXP object ){ R_PreserveObject(object); }
+void Rcpp_ReleaseObject( SEXP object ){ R_ReleaseObject(object); }
+
#include <Rcpp/barrier.h>
#define RcppExport extern "C"
Modified: pkg/Rcpp/src/cache.cpp
===================================================================
--- pkg/Rcpp/src/cache.cpp 2010-12-22 12:29:57 UTC (rev 2811)
+++ pkg/Rcpp/src/cache.cpp 2010-12-22 12:37:31 UTC (rev 2812)
@@ -47,7 +47,6 @@
// only used for debugging
SEXP get_rcpp_cache() { return Rcpp_cache ; }
-
SEXP init_Rcpp_cache(){
Rcpp_cache = PROTECT( Rf_allocVector( VECSXP, 10 ) );
More information about the Rcpp-commits
mailing list