search for: sxptype

Displaying 4 results from an estimated 4 matches for "sxptype".

Did you mean: sexptype
2017 Mar 29
3
Transferring ownership of R-managed buffer
I have a use case where I would like to create an SEXP around an existing buffer that is managed by R, thus avoiding a copy operation. If I have something like: void *p = (void*) RAW(PROTECT(Rf_allocVector(RAWSXP, n))); ... additional maniupulation ... SEXP x = somefunc(SXPTYPE, n, p); // ???? Is there a "placement" constructor available? (I have arranged for the corresponding UNPROTECT.) I've looked at and experimented with R_allocator and allocVector3, but can't quite get it right. I know this is odd, but it makes sense for my use case. Thanks for a...
2017 Mar 29
2
Transferring ownership of R-managed buffer
...returnable (hypothesis!) to the R interpreter as a vector (not external pointer) without a copy operation. > > If I have >> something like: >> >> void *p = (void*) RAW(PROTECT(Rf_allocVector(RAWSXP, n))); >> ... additional maniupulation ... >> SEXP x = somefunc(SXPTYPE, n, p); // ???? >> >> Is there a "placement" constructor available? >> > > What's a "placement" constructor? > Function that constructs an object using previously allocated memory (for example provided by a 3rd party library). In some cases, resp...
2017 Mar 29
0
Transferring ownership of R-managed buffer
...ffer that is managed by R, thus avoiding a copy operation. What to you mean exactly by "an existing buffer managed by R"? > If I have > something like: > > void *p = (void*) RAW(PROTECT(Rf_allocVector(RAWSXP, n))); > ... additional maniupulation ... > SEXP x = somefunc(SXPTYPE, n, p); // ???? > > Is there a "placement" constructor available? What's a "placement" constructor? >(I have arranged for the > corresponding UNPROTECT.) I've looked at and experimented with R_allocator > and allocVector3, but can't quite get it rig...
2017 Mar 29
0
Transferring ownership of R-managed buffer
...as a > vector (not external pointer) without a copy operation. > > > > > If I have > >> something like: > >> > >> void *p = (void*) RAW(PROTECT(Rf_allocVector(RAWSXP, n))); > >> ... additional maniupulation ... > >> SEXP x = somefunc(SXPTYPE, n, p); // ???? > >> > >> Is there a "placement" constructor available? > >> > > > > What's a "placement" constructor? > > > > Function that constructs an object using previously allocated memory (for > example provided...