[Rcpp-commits] r3475 - in pkg/Rcpp: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 15 14:04:18 CET 2012


Author: edd
Date: 2012-02-15 14:04:17 +0100 (Wed, 15 Feb 2012)
New Revision: 3475

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/src/Evaluator.cpp
Log:
do not use Rf_install inside another R API call


Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2012-02-15 13:03:18 UTC (rev 3474)
+++ pkg/Rcpp/ChangeLog	2012-02-15 13:04:17 UTC (rev 3475)
@@ -1,3 +1,7 @@
+2011-12-16  Douglas Bates  <bates at stat.wisc.edu>
+
+        * src/Evaluator.cpp: Avoid Rf_install inside an R API call
+
 2012-02-12  Dirk Eddelbuettel  <edd at debian.org>
 
 	* R/excections.R: Revert to previous use with .Internal

Modified: pkg/Rcpp/src/Evaluator.cpp
===================================================================
--- pkg/Rcpp/src/Evaluator.cpp	2012-02-15 13:03:18 UTC (rev 3474)
+++ pkg/Rcpp/src/Evaluator.cpp	2012-02-15 13:04:17 UTC (rev 3475)
@@ -2,7 +2,7 @@
 //
 // Evaluator.cpp: Rcpp R/C++ interface class library -- evaluator
 //
-// Copyright (C) 2009 - 2012 Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2009 - 2012  Dirk Eddelbuettel and Romain Francois
 //
 // This file is part of Rcpp.
 //
@@ -30,11 +30,13 @@
         maybe_init() ;
         reset_current_error() ; 
         Environment RCPP = Environment::Rcpp_namespace(); 
+        static SEXP rcpp_tryCatch = NULL;
+        if (!rcpp_tryCatch) rcpp_tryCatch = ::Rf_install( "rcpp_tryCatch" );
         
         SEXP call = PROTECT( 
                             Rf_lang2( 
                                      // internal::get_rcpptrycatch() ,
-                                     Rf_install( "rcpp_tryCatch" ), 
+                                     rcpp_tryCatch,
                                      Rf_lang3( internal::get_evalq() , expr, env )
                                      // , 
                                      // Rf_eval( Rf_install(".rcpp_error_recorder"),  RCPP )



More information about the Rcpp-commits mailing list