[Rcpp-commits] r4253 - in pkg/Rcpp: . inst/unitTests src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 12 16:52:30 CET 2013


Author: romain
Date: 2013-02-12 16:52:30 +0100 (Tue, 12 Feb 2013)
New Revision: 4253

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/unitTests/runit.Module.R
   pkg/Rcpp/src/api.cpp
Log:
more careful about stack

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2013-02-11 20:06:36 UTC (rev 4252)
+++ pkg/Rcpp/ChangeLog	2013-02-12 15:52:30 UTC (rev 4253)
@@ -1,3 +1,7 @@
+2013-02-12 Romain Francois <romain at r-enthusiasts.com>
+
+        * src/api.cpp : More careful about RCPP_PROTECTION_STACK init
+
 2013-02-08 Romain Francois <romain at r-enthusiasts.com>
 
         * include/Rcpp/as.h: re-enable as<std::string>(  CharacterVector[int] ) 

Modified: pkg/Rcpp/inst/unitTests/runit.Module.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.Module.R	2013-02-11 20:06:36 UTC (rev 4252)
+++ pkg/Rcpp/inst/unitTests/runit.Module.R	2013-02-12 15:52:30 UTC (rev 4253)
@@ -22,7 +22,8 @@
 	gc()
 }
 
-.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
+# .runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
+.runThisTest <- FALSE 
 
 if( .runThisTest && Rcpp:::capabilities()[["Rcpp modules"]] ) {
 

Modified: pkg/Rcpp/src/api.cpp
===================================================================
--- pkg/Rcpp/src/api.cpp	2013-02-11 20:06:36 UTC (rev 4252)
+++ pkg/Rcpp/src/api.cpp	2013-02-12 15:52:30 UTC (rev 4253)
@@ -34,14 +34,16 @@
     // {{{ SexpStack
     static SEXP RCPP_PROTECTION_STACK = R_NilValue ;
     static SEXP* RCPP_PROTECTION_STACK_PTR = 0 ;
+    static bool RCPP_PROTECTION_STACK_READY = false ;
     
     #define GET_TOP() TRUELENGTH(RCPP_PROTECTION_STACK)
     #define SET_TOP(TOP) SET_TRUELENGTH(RCPP_PROTECTION_STACK, TOP)
     
     inline void init_ProtectionStack(){
-        if(RCPP_PROTECTION_STACK == R_NilValue){
+        if(!RCPP_PROTECTION_STACK_READY){
             RCPP_PROTECTION_STACK = get_Rcpp_protection_stack() ;
             RCPP_PROTECTION_STACK_PTR = get_vector_ptr(RCPP_PROTECTION_STACK) ;
+            RCPP_PROTECTION_STACK_READY = true ;
         }
     }
     



More information about the Rcpp-commits mailing list