MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / get_cache

Function get_cache

src/barrier.cpp:248–260  ·  view source on GitHub ↗

[[Rcpp::register]]

Source from the content-addressed store, hash-verified

246
247// [[Rcpp::register]]
248int* get_cache(int m) {
249 SEXP cache = get_rcpp_cache();
250 SEXP hash_cache = VECTOR_ELT(cache, RCPP_HASH_CACHE_INDEX);
251 int n = Rf_length(hash_cache);
252 if (m > n) {
253 Rcpp::Shield<SEXP> new_hash_cache(Rf_allocVector(INTSXP, m));
254 hash_cache = new_hash_cache;
255 SET_VECTOR_ELT(cache,RCPP_HASH_CACHE_INDEX, hash_cache);
256 }
257 int *res = INTEGER(hash_cache);
258 std::fill(res, res+m, 0);
259 return res;
260}

Callers

nothing calls this directly

Calls 1

get_rcpp_cacheFunction · 0.85

Tested by

no test coverage detected