search for: allocvector3

Displaying 9 results from an estimated 9 matches for "allocvector3".

Did you mean: allocvector
2014 Oct 22
2
Using a custom memory allocation function in R
...with four 12-core AMD Opteron 6174 CPUs). Now I have two functions for allocating and freeing memory: numa_alloc_onnode and numa_free(courtesy of http://stackoverflow.com/questions/8154162/numa-aware-cache-aligned-memory-allocation). I'm using R version 3.1.1, so I have access to the function allocVector3(src/main/memory.c), which seems to me as the intended way of adding a custom memory allocator. I also found the struct R_allocator in src/include/R_ext However it is not clear to me how to put these pieces together. Let's say, in R, I want the result res of an evaluation such as res <- Y -...
2017 Mar 29
3
Transferring ownership of R-managed buffer
...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 any pointers. THK http://www.keittlab.org/ [[alternative HTML version deleted]]
2019 May 19
4
most robust way to call R API functions from a secondary thread
...heckStack() might be executed (indirectly), which will (probably) signal a stack overflow because it only works correctly when called form the main thread (see https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Threading-issues); in particular, any function that does allocations, e.g. via allocVector3() might end up calling it via GC -> finalizer -> ... -> eval; the only way around this problem which I could find is to adjust R_CStackLimit, which is outside of the official API; it can be set to -1 to disable the check or be changed to a value appropriate for the current thread 4) R set...
2017 Mar 29
2
Transferring ownership of R-managed buffer
...ocated memory (for example provided by a 3rd party library). In some cases, responsibility for further management of the buffer is transferred to the new object. > > (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. >> > > Not sure I follow what you are trying to do. Note that an SEXP is a > pointer to a C struct called SEXPREC. I think that trying to point an > SEXPREC struct to data pointed t...
2017 Mar 29
0
Transferring ownership of R-managed buffer
...upulation ... > 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 right. I know this is odd, but it > makes sense for my use case. Not sure I follow what you are trying to do. Note that an SEXP is a pointer to a C struct called SEXPREC. I think that trying to point an SEXPREC struct to data pointed to by an existing SEXPREC struct...
2019 May 20
1
most robust way to call R API functions from a secondary thread
...hreading-2Dissues&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=neKFCw86thQe2E2-61NAgpDMw4cC7oD_tUTTzraOkQM&m=d1r2raD4w0FF7spOVuz2IVEo0P_II3ZtSbw0TU2NmaE&s=J_TMw2gu43dxB_EX2vHbtF4Zr4bIAFR8RSFzvbRV6jE&e=); in particular, any function that does allocations, e.g. via allocVector3() might end up calling it via GC -> finalizer -> ... -> eval; the only way around this problem which I could find is to adjust R_CStackLimit, which is outside of the official API; it can be set to -1 to disable the check or be changed to a value appropriate for the current thread >>...
2017 Mar 29
0
Transferring ownership of R-managed buffer
...of the primary use cases of the ALTREP stuff. I don't think you can do what you're describing now. See my comments below. > > > > > (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. > >> > > > > Not sure I follow what you are trying to do. Note that an SEXP is a > > pointer to a C struct called SEXPREC. I think that trying to point an > &g...
2019 May 20
0
[External] most robust way to call R API functions from a secondary thread
...heckStack() might be executed (indirectly), which will (probably) signal a stack overflow because it only works correctly when called form the main thread (see https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Threading-issues); in particular, any function that does allocations, e.g. via allocVector3() might end up calling it via GC -> finalizer -> ... -> eval; the only way around this problem which I could find is to adjust R_CStackLimit, which is outside of the official API; it can be set to -1 to disable the check or be changed to a value appropriate for the current thread > >...
2019 May 20
0
most robust way to call R API functions from a secondary thread
...hreading-2Dissues&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=neKFCw86thQe2E2-61NAgpDMw4cC7oD_tUTTzraOkQM&m=d1r2raD4w0FF7spOVuz2IVEo0P_II3ZtSbw0TU2NmaE&s=J_TMw2gu43dxB_EX2vHbtF4Zr4bIAFR8RSFzvbRV6jE&e=); in particular, any function that does allocations, e.g. via allocVector3() might end up calling it via GC -> finalizer -> ... -> eval; the only way around this problem which I could find is to adjust R_CStackLimit, which is outside of the official API; it can be set to -1 to disable the check or be changed to a value appropriate for the current thread > &gt...