Displaying 10 results from an estimated 10 matches for "nextcontext".
Did you mean:
next_context
2009 Mar 03
1
profiler and loops
...cks. The coder of
script1 would not know what to do to improve 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(PR...
2000 Nov 07
0
error handling
...= eval(R_CurrentExpr , rho);
will appear to work the first time there is an error, but the second error
causes an infinite loop. I have identified the location where the loop
occurs. It is in the function jump_to_toplevel() in errors.c inside the for
loop:
for (c = R_GlobalContext; c; c = c->nextcontext) { ... }
I have found a work around for this but is seems cludgy and I don't know the
POTENTIAL PROBLEMS that might be introduced. It involves setting up a
context and forcing R_GlobalContext's nextcontext to 0, as in the following
(by the way, this same approach doesn't work in the ex...
2004 Jun 28
2
Problem with hasArg and the ... argument (PR#7027)
Full_Name: Jelle Goeman
Version: 1.9.0
OS: mingw32, windows 2000
Submission from: (NULL) (145.88.209.33)
Hi Everyone,
I get very strange results using the function hasArg with the ... function
argument. In my own function:
> gt <- globaltest(X,Y)
> sampling(gt)
works fine, but
> sampling(globaltest(X,Y))
results in:
Error in eval(expr, envir, enclos) : "missing"
1997 Aug 05
1
R-beta: Characters in .C
I am having some difficulties using dynamically loaded
C functions on a Sparc 10 with R compiled
using cc (both R-0.49 and R-0.50). I get sporadic errors with the
error message:
Error: character variables must be duplicated in .C/.Fortran,
with C functions which pass character variables.
my C functions look like: anyfunc(char **filename, other variables )
This error message appears about 25%
1997 Aug 05
1
R-beta: Characters in .C
I am having some difficulties using dynamically loaded
C functions on a Sparc 10 with R compiled
using cc (both R-0.49 and R-0.50). I get sporadic errors with the
error message:
Error: character variables must be duplicated in .C/.Fortran,
with C functions which pass character variables.
my C functions look like: anyfunc(char **filename, other variables )
This error message appears about 25%
2020 Feb 26
1
Profiling: attributing costs to place of invocation (instead of place of evaluation)?
...=========================================
--- src/main/eval.c??? (revision 77857)
+++ src/main/eval.c??? (working copy)
@@ -218,7 +218,10 @@
???? if (R_Line_Profiling)
???? lineprof(buf, 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...
2016 Jun 04
1
RProfmem output format
...t reported as:
192 :
360 :
360 :
1064 :
2040 :"raw"
This 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) == SYM...
2003 Mar 26
0
Rprof/UseMethod
...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 complaints
about the use of env from make...
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
...ate? */
-static FILE *R_MemReportingOutfile;
-static R_size_t R_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)) :
-...