27#include <Rinternals.h>
37 return STRING_ELT(x, i);
42 return CHAR(STRING_ELT(x, i));
47 SET_STRING_ELT(x, i, value);
52 SET_STRING_ELT(x, i, Rf_mkChar(value));
63 return VECTOR_ELT(x, i);
68 SET_VECTOR_ELT(x, i, value);
80 return const_cast<void*
>(DATAPTR_RO(x));
91#define RCPP_HASH_CACHE_INDEX 4
92#define RCPP_CACHE_SIZE 5
94#ifndef RCPP_HASH_CACHE_INITIAL_SIZE
95#define RCPP_HASH_CACHE_INITIAL_SIZE 1024
111 if (
object == R_NilValue) {
116 SET_TAG(cell,
object);
118 if (CDR(cell) != R_NilValue) {
119 SETCAR(CDR(cell), cell);
126 if (token == R_NilValue || TYPEOF(token) != LISTSXP) {
129 SET_TAG(token, R_NilValue);
130 SEXP before = CAR(token);
131 SEXP after = CDR(token);
132 SETCDR(before, after);
133 if (after != R_NilValue) {
134 SETCAR(after, before);
143 SEXP getNamespaceSym = Rf_install(
"getNamespace");
148#if R_VERSION < R_Version(4,5,0)
149 Rcpp_cache = Rf_findVarInFrame(RCPP, Rf_install(
".rcpp_cache"));
151 Rcpp_cache = R_getVar(Rf_install(
".rcpp_cache"), RCPP, TRUE);
179 SET_VECTOR_ELT(cache, 1, e);
184 SET_VECTOR_ELT(cache, 2, e);
189 SEXP getNamespaceSym = Rf_install(
"getNamespace");
196 SET_VECTOR_ELT(cache, 0, RCPP);
199 SET_VECTOR_ELT(cache, 3, R_NilValue);
202 Rf_defineVar(Rf_install(
".rcpp_cache"), cache, RCPP);
218 SET_VECTOR_ELT(cache, 3, R_NilValue);
226 return LOGICAL(err)[0];
251 int n = Rf_length(hash_cache);
254 hash_cache = new_hash_cache;
257 int *res = INTEGER(hash_cache);
258 std::fill(res, res+m, 0);
void char_set_string_elt(SEXP x, R_xlen_t i, const char *value)
#define RCPP_HASH_CACHE_INDEX
SEXP set_current_error(SEXP cache, SEXP e)
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)
const char * char_get_string_elt(SEXP x, R_xlen_t i)
void set_vector_elt(SEXP x, R_xlen_t i, SEXP value)
const char * char_nocheck(SEXP x)
SEXP * get_vector_ptr(SEXP x)
SEXP * get_string_ptr(SEXP x)
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)
internal implementation details
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