search for: ctxt_builtin

Displaying 6 results from an estimated 6 matches for "ctxt_builtin".

2009 Mar 03
1
profiler and loops
...on the script. I have had a quick look in the code, and here are a few thoughts: in the function "doprof" in eval.c, this loop write the call stack on the profiler file: for (cptr = R_GlobalContext; cptr; cptr = cptr->nextcontext) { if ((cptr->callflag & (CTXT_FUNCTION | CTXT_BUILTIN)) && TYPEOF(cptr->call) == LANGSXP) { SEXP fun = CAR(cptr->call); if (!newline) newline = 1; fprintf(R_ProfileOutfile, "\"%s\" ", TYPEOF(fun) == SYMSXP ? CHAR(PRINTNAME(fun)) : "<Anonymous>"); }...
2020 Feb 26
1
Profiling: attributing costs to place of invocation (instead of place of evaluation)?
...R_getCurrentSrcref()); +??? SEXP sysparent = NULL; + ???? for (cptr = R_GlobalContext; cptr; cptr = cptr->nextcontext) { +??? if (sysparent != NULL && cptr->cloenv != sysparent && cptr->sysparent != sysparent) continue; ???? if ((cptr->callflag & (CTXT_FUNCTION | CTXT_BUILTIN)) ???? ??? && TYPEOF(cptr->call) == LANGSXP) { ???? ??? SEXP fun = CAR(cptr->call); @@ -292,6 +295,8 @@ ???? ??? ??? else ???? ??? ??? lineprof(buf, cptr->srcref); ???? ??? } + +??? ??? sysparent = cptr->sysparent; ???? ??? } ???? } ???? }
2016 Jun 04
1
RProfmem output format
...was/is because C function R_OutputStackTrace() - part of src/main/memory.c - looks like: static void R_OutputStackTrace(FILE *file) { int newline = 0; RCNTXT *cptr; for (cptr = R_GlobalContext; cptr; cptr = cptr->nextcontext) { if ((cptr->callflag & (CTXT_FUNCTION | CTXT_BUILTIN)) && TYPEOF(cptr->call) == LANGSXP) { SEXP fun = CAR(cptr->call); if (!newline) newline = 1; fprintf(file, "\"%s\" ", TYPEOF(fun) == SYMSXP ? CHAR(PRINTNAME(fun)) : "<Anonymous>&qu...
2003 Mar 26
0
Rprof/UseMethod
...hanging cptr = R_GlobalContext; if ( !(cptr->callflag & CTXT_FUNCTION) || cptr->cloenv != env) error("UseMethod used in an inappropriate fashion"); # # it two places in objects.c to # cptr = R_GlobalContext; if (cptr->callflag == CTXT_BUILTIN) cptr = cptr->nextcontext; if ( !(cptr->callflag & CTXT_FUNCTION) || cptr->cloenv != env) error("UseMethod used in an inappropriate fashion"); # # might fix this. # I tried this, on my solaris "R version 1.7.0, 2003-02-05" but got...
2002 Jul 19
1
Rprof and setMethod conflict?
I noticed this oddity about R profiling and setMethod. First, I "test out" Rprof. > require(methods) Loading required package: methods [1] TRUE > > Rprof("test.out") > data.frame("a") X.a. 1 a > Rprof(NULL) So far, so good. Next, I define myClass. > setClass("myClass", representation(mySlot = "numeric")) [1]
2011 Aug 14
0
Improved version of Rprofmem
..._MemReportingThreshold; + newline = R_MemReportingToTerminal | R_MemDetailsReporting; -static void R_OutputStackTrace(FILE *file) -{ - int newline = 0; - RCNTXT *cptr; - for (cptr = R_GlobalContext; cptr; cptr = cptr->nextcontext) { if ((cptr->callflag & (CTXT_FUNCTION | CTXT_BUILTIN)) && TYPEOF(cptr->call) == LANGSXP) { SEXP fun = CAR(cptr->call); if (!newline) newline = 1; - fprintf(file, "\"%s\" ", - TYPEOF(fun) == SYMSXP ? CHAR(PRINTNAME(fun)) : - "<Anonymous>"); + if (R_MemReportingOutfil...