Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching from Rcpp_eval to Rcpp_fast_eval. close #866 #867

Merged
merged 3 commits into from Jun 17, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/barrier.cpp
Expand Up @@ -28,8 +28,6 @@
#include <algorithm>
#include <Rcpp/protection/Shield.h>

namespace Rcpp { SEXP Rcpp_eval(SEXP, SEXP); }

// [[Rcpp::register]]
SEXP get_string_elt(SEXP x, R_xlen_t i) {
return STRING_ELT(x, i);
Expand Down Expand Up @@ -97,7 +95,7 @@ SEXP get_rcpp_cache() {
SEXP getNamespaceSym = Rf_install("getNamespace"); // cannot be gc()'ed once in symbol table
Rcpp::Shield<SEXP> RcppString(Rf_mkString("Rcpp"));
Rcpp::Shield<SEXP> call(Rf_lang2(getNamespaceSym, RcppString));
Rcpp::Shield<SEXP> RCPP(Rcpp_eval(call, R_GlobalEnv));
Rcpp::Shield<SEXP> RCPP(Rf_eval(call, R_GlobalEnv));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be evaluated in base or in the Rcpp namespace.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most (all?) of these Rcpp_eval() / Rcpp_fast_eval() actually :)

Probably best to make these changes in another PR. And merge / check that PR before this one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or modify this one and test it again?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking a different PR would make things easier should this one be reversed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. On the other hand this one "does no harm" / has no effect until the #define. So we could merge, merge the two smaller ones behind it and have a new baseline to work from. We surely have different paths forward...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can send another PR and I will reverse this commit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? This PR is three commits. What do you suggest reversing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean the changes in barrier.cpp.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could do. And test that again, or first against those three? And wasn't there a link issue?


Rcpp_cache = Rf_findVarInFrame(RCPP, Rf_install(".rcpp_cache"));
Rcpp_cache_know = true;
Expand Down Expand Up @@ -139,7 +137,7 @@ SEXP init_Rcpp_cache() {
SEXP getNamespaceSym = Rf_install("getNamespace"); // cannot be gc()'ed once in symbol table
Rcpp::Shield<SEXP> RcppString(Rf_mkString("Rcpp"));
Rcpp::Shield<SEXP> call(Rf_lang2(getNamespaceSym, RcppString));
Rcpp::Shield<SEXP> RCPP(Rcpp_eval(call, R_GlobalEnv));
Rcpp::Shield<SEXP> RCPP(Rf_eval(call, R_GlobalEnv));
Rcpp::Shield<SEXP> cache(Rf_allocVector(VECSXP, RCPP_CACHE_SIZE));

// the Rcpp namespace
Expand Down