search for: r_ppstacktop

Displaying 11 results from an estimated 11 matches for "r_ppstacktop".

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_PPSt...
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_PPSta...
2007 Jan 03
1
troubles installing SJava for R
...ppears when I try to load SJava: ... Type 'q()' to quit R. > library(SJava) Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library '/usr/local/lib/R/library/SJava/libs/SJava.so': /usr/local/lib/R/library/SJava/libs/SJava.so: undefined symbol: R_PPStackTop Error in library(SJava) : .First.lib failed for 'SJava' > q() ... Can anyone please help? Regards, Erik -- We are not a clone.
2019 May 19
4
most robust way to call R API functions from a secondary thread
...d if the secondary threads use memory which was allocated in fun_running_in_main_thread() using e.g. R_alloc(). Best regards, Andreas Kersting #include <Rinternals.h> #include <pthread.h> #include <signal.h> #include <stdint.h> extern uintptr_t R_CStackLimit; extern int R_PPStackTop; extern int R_PPStackSize; #include <R_ext/libextern.h> LibExtern Rboolean R_interrupts_suspended; LibExtern int R_interrupts_pending; extern void Rf_onintr(void); // mutex for exclusive access to the R API: static pthread_mutex_t r_api_mutex = PTHREAD_MUTEX_INITIALIZER; // a wrapper arrou...
2006 Jun 29
3
Continuation and parse
Hi gurus, After an unsuccessful scrabble through the documentation and Jon's excellent search facility, I am no wiser as to how R recognizes an incomplete command line and politely raises its hand for more. The help page for parse gives no indication that it does anything more than spit the dummy when fed an incomplete command line, but something in there must recognize such ellipsis.
2006 Jun 29
3
Continuation and parse
Hi gurus, After an unsuccessful scrabble through the documentation and Jon's excellent search facility, I am no wiser as to how R recognizes an incomplete command line and politely raises its hand for more. The help page for parse gives no indication that it does anything more than spit the dummy when fed an incomplete command line, but something in there must recognize such ellipsis.
2019 May 20
1
most robust way to call R API functions from a secondary thread
...nning_in_main_thread() using e.g. R_alloc(). >> Best regards, >> Andreas Kersting >> #include <Rinternals.h> >> #include <pthread.h> >> #include <signal.h> >> #include <stdint.h> >> extern uintptr_t R_CStackLimit; >> extern int R_PPStackTop; >> extern int R_PPStackSize; >> #include <R_ext/libextern.h> >> LibExtern Rboolean R_interrupts_suspended; >> LibExtern int R_interrupts_pending; >> extern void Rf_onintr(void); >> // mutex for exclusive access to the R API: >> static pthread_mutex_t...
2019 May 20
0
[External] most robust way to call R API functions from a secondary thread
...fun_running_in_main_thread() using e.g. R_alloc(). > > Best regards, > Andreas Kersting > > > > #include <Rinternals.h> > #include <pthread.h> > #include <signal.h> > #include <stdint.h> > > extern uintptr_t R_CStackLimit; > extern int R_PPStackTop; > extern int R_PPStackSize; > > #include <R_ext/libextern.h> > LibExtern Rboolean R_interrupts_suspended; > LibExtern int R_interrupts_pending; > extern void Rf_onintr(void); > > // mutex for exclusive access to the R API: > static pthread_mutex_t r_api_mutex = PTH...
2019 May 20
0
most robust way to call R API functions from a secondary thread
...running_in_main_thread() using e.g. R_alloc(). > > Best regards, > Andreas Kersting > > > > #include <Rinternals.h> > #include <pthread.h> > #include <signal.h> > #include <stdint.h> > > extern uintptr_t R_CStackLimit; > extern int R_PPStackTop; > extern int R_PPStackSize; > > #include <R_ext/libextern.h> > LibExtern Rboolean R_interrupts_suspended; > LibExtern int R_interrupts_pending; > extern void Rf_onintr(void); > > // mutex for exclusive access to the R API: > static pthread_mutex_t r_api_mutex = P...
2009 Mar 03
1
profiler and loops
...h as the name implies, begins the context of the for loop. The begincontext function looks like this : void begincontext(RCNTXT * cptr, int flags, SEXP syscall, SEXP env, SEXP sysp, SEXP promargs, SEXP callfun) { cptr->nextcontext = R_GlobalContext; cptr->cstacktop = R_PPStackTop; cptr->evaldepth = R_EvalDepth; cptr->callflag = flags; cptr->call = syscall; cptr->cloenv = env; cptr->sysparent = sysp; cptr->conexit = R_NilValue; cptr->cend = NULL; cptr->promargs = promargs; cptr->callfun = callfun; cptr->vmax = vmaxg...
2007 Jan 18
0
Emulating a REPL in frontends
...value, int print_mode, Rboolean do_toplevel_callbacks) { int c; ParseStatus status; SEXP value; SEXP rho = R_GlobalEnv; Rboolean wasDisplayed = FALSE; while((c = *buffer++)) { R_IoBufferPutc(c, &R_ConsoleIob); if(c == ';' || c == '\n') break; } R_PPStackTop = 0; R_CurrentExpr = R_Parse1Buffer(&R_ConsoleIob, 0, &status); if(parse_status) *parse_status = status; switch(status) { case PARSE_NULL: R_IoBufferWriteReset(&R_ConsoleIob); break; case PARSE_OK: R_IoBufferReadReset(&R_ConsoleIob); R_CurrentExpr = R_Parse1...