Re: [Rcpp-devel] Range constructor and memory allocation

2014-02-19 Thread Dirk Eddelbuettel
On 19 February 2014 at 09:53, Gregor Kastner wrote: | To sum up: | | R (reuse)> Rcpp (reuse)> RcppArmadillo | | but | | RcppArmadillo (fresh)> Rcpp (reuse)> R | | Correct? I think so. And the dreaded '(fresh)' in the second line may be hard to avoid. We need

Re: [Rcpp-devel] Range constructor and memory allocation

2014-02-19 Thread Gregor Kastner
Hi Kevin, hi Dirk, K> All R data internally is a SEXPREC, ie, a C struct full of different K> bits of information. The data part of a SEXPREC is forced to a K> specific offset from the C structure, e.g. from Rinternals.h: K> K> /* Under the generational allocator the data for vector nodes comes K

Re: [Rcpp-devel] Range constructor and memory allocation

2014-02-18 Thread Dirk Eddelbuettel
On 18 February 2014 at 19:12, Gregor Kastner wrote: | Dear all, | | while writing an iterator hack for the problem encountered a few hours ago | and posted here: | | https://www.mail-archive.com/rcpp-devel@lists.r-forge.r-project.org/msg06810.html, | | I have noticed that the default behavior

Re: [Rcpp-devel] Range constructor and memory allocation

2014-02-18 Thread Kevin Ushey
Hi Gregor, I don't think it's possible at this point. Some technical details follow: All R data internally is a SEXPREC, ie, a C struct full of different bits of information. The data part of a SEXPREC is forced to a specific offset from the C structure, e.g. from Rinternals.h: /* Under the gene

[Rcpp-devel] Range constructor and memory allocation

2014-02-18 Thread Gregor Kastner
Dear all, while writing an iterator hack for the problem encountered a few hours ago and posted here: https://www.mail-archive.com/rcpp-devel@lists.r-forge.r-project.org/msg06810.html, I have noticed that the default behavior for the range constructor for e.g. Rcpp::NumericVector seems to be to