search for: r_ppstack

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

Did you mean: ppstack
2008 Feb 23
0
patch: two minor debugging-related pointer protection stack issues (PR#10832)
...evel trunk: Index: trunk/src/main/memory.c =================================================================== --- trunk/src/main/memory.c (revision 44589) +++ trunk/src/main/memory.c (working copy) @@ -1557,7 +1557,7 @@ R_Suicide("couldn't allocate memory for pointer stack"); R_PPStackTop = 0; #if VALGRIND_LEVEL > 1 - VALGRIND_MAKE_NOACCESS(R_PPStackTop+R_PPStackSize,PP_REDZONE_SIZE); + VALGRIND_MAKE_NOACCESS(R_PPStack+R_PPStackSize,PP_REDZONE_SIZE); #endif vsfac = sizeof(VECREC); R_VSize = (((R_VSize + 1)/ vsfac)); @@ -2329,11 +2329,11 @@ } while ( R_PP...
2010 Aug 23
1
Speed improvement to PROTECT, UNPROTECT, etc.
...de, one can redefine the macros to handled to the common case inline, and call the function in memory.c for the uncommon cases (eg, error on stack underflow). Here are my versions that do this: #define PROTECT(s) do { \ SEXP tmp_prot_sexp = (s); \ if (R_PPStackTop < R_PPStackSize) \ R_PPStack[R_PPStackTop++] = tmp_prot_sexp; \ else \ Rf_protect(tmp_prot_sexp); \ } while (0) #define UNPROTECT(n) (R_PPStackTop >= (n) ? \ (void) (R_P...
2010 Jan 02
3
R-devel Digest, Vol 83, Issue 2
...garbage collection instead of the PROTECT/UNPROTECT dance. This seems to > work well, but I was wondering if there was documentation about it. The most precise technical documentation is in memory.c PROTECT is an alias for Rf_protect, itself an alias for SEXP protect(SEXP s); and uses a stack (R_PPStack) to store protected objects. > In particular, if we preserve the same SEXP twice (or more), should we > implement some sort of reference counting ? This depends on the requirements for your system. For example, in rpy2 I added a reference counting layer(*) because I wanted to allow severa...
2009 Sep 03
1
Running an expression 1MN times using embedded R
...1:5){ .Call('rh_status','x') }}) a million times from a program with R embedded in it. I have attached reproducible code that crashes with Program received signal SIGSEGV, Segmentation fault. 0x00002b499ca40a6e in R_gc_internal (size_needed=0) at memory.c:1309 1309 FORWARD_NODE(R_PPStack[i]); Current language: auto; currently c (bt output below) The code crashes with R-2.8 on both OS X (10.5) and Linux (Linux 2.6.18-128.4.1.el5 #1 SMP Thu Jul 23 19:59:19 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux) Most of the code has been taken from the R extensions website, I would appreci...