22 #define COMPILING_RCPP
24 #define USE_RINTERNALS
25 #include <Rinternals.h>
33 return STRING_ELT(x, i);
38 return CHAR(STRING_ELT(x, i));
43 SET_STRING_ELT(x, i, value);
48 SET_STRING_ELT(x, i, Rf_mkChar(value));
58 return VECTOR_ELT(x, i);
63 SET_VECTOR_ELT(x, i, value);
84 #define RCPP_HASH_CACHE_INDEX 4
85 #define RCPP_CACHE_SIZE 5
87 #ifndef RCPP_HASH_CACHE_INITIAL_SIZE
88 #define RCPP_HASH_CACHE_INITIAL_SIZE 1024
104 if (
object == R_NilValue) {
109 SET_TAG(cell,
object);
111 if (CDR(cell) != R_NilValue) {
112 SETCAR(CDR(cell), cell);
119 if (token == R_NilValue || TYPEOF(token) != LISTSXP) {
122 SET_TAG(token, R_NilValue);
123 SEXP before = CAR(token);
124 SEXP after = CDR(token);
125 SETCDR(before, after);
126 if (after != R_NilValue) {
127 SETCAR(after, before);
136 SEXP getNamespaceSym = Rf_install(
"getNamespace");
141 Rcpp_cache = Rf_findVarInFrame(RCPP, Rf_install(
".rcpp_cache"));
168 SET_VECTOR_ELT(cache, 1, e);
173 SET_VECTOR_ELT(cache, 2, e);
178 SEXP getNamespaceSym = Rf_install(
"getNamespace");
185 SET_VECTOR_ELT(cache, 0, RCPP);
188 SET_VECTOR_ELT(cache, 3, R_NilValue);
191 Rf_defineVar(Rf_install(
".rcpp_cache"), cache, RCPP);
207 SET_VECTOR_ELT(cache, 3, R_NilValue);
215 return LOGICAL(err)[0];
240 int n = Rf_length(hash_cache);
243 hash_cache = new_hash_cache;
246 int *res = INTEGER(hash_cache);
247 std::fill(res, res+m, 0);
SEXP * get_string_ptr(SEXP x)
void char_set_string_elt(SEXP x, R_xlen_t i, const char *value)
const char * char_nocheck(SEXP x)
#define RCPP_HASH_CACHE_INDEX
SEXP set_current_error(SEXP cache, SEXP e)
const char * char_get_string_elt(SEXP x, R_xlen_t i)
SEXP * get_vector_ptr(SEXP x)
SEXP get_vector_elt(SEXP x, R_xlen_t i)
#define RCPP_HASH_CACHE_INITIAL_SIZE
SEXP reset_current_error()
SEXP rcpp_error_recorder(SEXP e)
static bool Rcpp_cache_know
SEXP get_string_elt(SEXP x, R_xlen_t i)
void set_vector_elt(SEXP x, R_xlen_t i, SEXP value)
SEXP rcpp_get_current_error()
SEXP set_error_occured(SEXP cache, SEXP e)
SEXP rcpp_get_stack_trace()
SEXP rcpp_set_stack_trace(SEXP e)
void set_string_elt(SEXP x, R_xlen_t i, SEXP value)
attribute_hidden SEXP get_Rcpp_namespace()
attribute_hidden void Rcpp_precious_init()
attribute_hidden SEXP Rcpp_precious_preserve(SEXP object)
attribute_hidden void Rcpp_precious_remove(SEXP token)
attribute_hidden void Rcpp_precious_teardown()
static SEXP Rcpp_precious