[[Rcpp::register]]
| 246 | |
| 247 | // [[Rcpp::register]] |
| 248 | int* 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 | } |
nothing calls this directly
no test coverage detected