search for: prlst

Displaying 2 results from an estimated 2 matches for "prlst".

2020 Sep 11
4
Garbage collection of seemingly PROTECTed pairlist
...turn list(c(5L, 6L), c(7L, 10L), c(11L, 19L), c(20L, 30L)). Because the output is of variable length, I use a pairlist (because it is growable) and then I call Rf_PairToVectorList() at the end to make it into a regular list. I'm getting a strange garbage collection error. My PROTECTed pairlist prlst gets garbage collected away and causes a memory leak error when I try to access it. Here's my code. #include <Rinternals.h> SEXP C_int_mat_nth_row_nrnc(int *int_mat_int, int nr, int nc, int n) { SEXP out = PROTECT(Rf_allocVector(INTSXP, nc)); int *out_int = INTEGER(out); if (n &...
2020 Sep 12
0
Garbage collection of seemingly PROTECTed pairlist
...L, 10L), c(11L, 19L), c(20L, > 30L)). Because the output is of variable length, I use a pairlist (because > it is growable) and then I call Rf_PairToVectorList() at the end to make it > into a regular list. > > I'm getting a strange garbage collection error. My PROTECTed pairlist prlst > gets garbage collected away and causes a memory leak error when I try to > access it. > > Here's my code. > > #include <Rinternals.h> > > > SEXP C_int_mat_nth_row_nrnc(int *int_mat_int, int nr, int nc, int n) { > SEXP out = PROTECT(Rf_allocVector(INTSXP,...