Displaying 20 results from an estimated 50 matches for "cptr".
Did you mean:
cpsr
2009 Mar 03
1
profiler and loops
...ler to point loops as responsible for bottlenecks. 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\&quo...
2020 Feb 26
1
Profiling: attributing costs to place of invocation (instead of place of evaluation)?
...ex: src/main/eval.c
===================================================================
--- 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)...
2016 Mar 16
4
Problem with __builtin_object_size when it depends on a condition
Optimizer doesn't know how to calculate the object size when it finds
condition that cannot be eliminated. There is example:
-----------------------------------------------
#include<stdlib.h>
#define STATIC_BUF_SIZE 10
#define LARGER_BUF_SIZE 30
size_t foo(int flag) {
char *cptr;
char chararray[LARGER_BUF_SIZE];
char chararray2[STATIC_BUF_SIZE];
if(flag)
cptr = chararray2;
else
cptr = chararray;
return __builtin_object_size(cptr, 2);
}
int main() {
size_t ret;
ret = foo(0);
printf("\n%d\n", ret);
return 0;
}
--------------...
2003 Mar 26
0
Rprof/UseMethod
...is sounds like a bug in the usemethod code. Profiling adds an extra
# evaluation context around builtins and that can confuse things that
# don't take this into account. I unfortunately don't have time to
# track this properly now, but on a quick glance it looks like changing
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)...
2016 Jun 04
1
RProfmem output format
...0 :1064 :2040 :"raw"
The question is why this is not 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(f...
2016 Mar 17
3
Problem with __builtin_object_size when it depends on a condition
...when it finds condition that cannot be eliminated. There is example:
>>
>> -----------------------------------------------
>> #include<stdlib.h>
>> #define STATIC_BUF_SIZE 10
>> #define LARGER_BUF_SIZE 30
>>
>> size_t foo(int flag) {
>> char *cptr;
>> char chararray[LARGER_BUF_SIZE];
>> char chararray2[STATIC_BUF_SIZE];
>> if(flag)
>> cptr = chararray2;
>> else
>> cptr = chararray;
>>
>> return __builtin_object_size(cptr, 2);
>> }
>>
>> int main() {
>>...
2011 Aug 07
2
[PATCH] kinit minor checkpatch cleanup
...e_to_dev.c
@@ -69,7 +69,7 @@ static dev_t try_name(char *name, int part)
return res + part;
}
- fail:
+fail:
return (dev_t) 0;
}
@@ -122,8 +122,8 @@ static inline dev_t name_to_dev_t_real(const char *name)
return st.st_rdev;
if (strncmp(name, "/dev/", 5)) {
- if ((cptr = strchr(devname+5, ':')) &&
- cptr[1] != '\0') {
+ cptr = strchr(devname+5, ':');
+ if (cptr && cptr[1] != '\0') {
/* Colon-separated decimal device number */
*cptr = '\0';
major_num = strtoul(devname+5, &e1, 10);
diff...
2004 May 07
3
Contribution to 3.8.1pl1
Hello,
I added the support for netgroups to be used in the
AllowUsers and DenyUsers parameters. This has some
advantages:
* hostnames or ip addresses need not to be written or
maintained in the sshd_config file, but can be kept
abstract names what also simplifies a bit largescale
openssh installations
* sshd_config needs not change and sshd be restarted
when changing the list of allowed /
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]
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%
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"
1998 Jan 03
1
R-beta: NextMethod(.Generic) bug
I'm a day-old R newbie (but a war-weary S veteran), with couple of
first-day questions:
In R 0.61, this code fails.
Ops.test <- function(e1,e2)
{
e1 <- NextMethod(.Generic)
e1
}
x <- 4
class(x) <- "test"
y <- x < 3
The error message is "Error in NextMethod(.Generic) : negative length vectors
are not allowed.".
I assume it is a bug.
2009 Jan 27
1
Segmentation fault in MSetIterator get_weight
Hi,
I'm using xapian with c# and mono and i'm having a segfault in get_weight.
When i print the index variable, the value is clearly too high.
I think something write over it. Do you have any idea on how i could
trace the beginning of the segmentation fault ?
Thanks,
--
Yann
2009 Mar 31
1
[PATCH 1/1] CORE/cache: add cache priority parameter
...ast recently used
+;
; Assumes CS == DS.
;
getcachesector:
@@ -82,6 +84,10 @@ getcachesector:
; Update LRU, then compute buffer address
TRACER 'H'
+ ; Skip LRU update if DX == 0
+ and dx,dx ; Set ZF
+ jz .hit_no_lru
+
; Remove from current position in the list
mov bx,[si+cptr.prev]
mov di,[si+cptr.next]
@@ -95,6 +101,8 @@ getcachesector:
mov [CachePtrs+cptr.prev],si
mov word [si+cptr.next],CachePtrs
+.hit_no_lru:
+ and ax,ax ; Clear ZF
sub si,CachePtrs+cptr_size
shl si,SECTOR_SHIFT-cptr_size_lg2 ; Buffer address
diff --git a/core/extlinux.asm b/core/ex...
2017 Jun 27
0
Seg Fault memory violation
...try=TRUE)
at eval.c:6400
#5 0x00007ffff78d4138 in Rf_eval (e=0x3ae5e38, rho=0x17f3d450) at eval.c:624
#6 0x00007ffff78d4a7e in forcePromise (e=e at entry=0x17f3d488) at eval.c:520
#7 0x00007ffff78d41ec in Rf_eval (e=0x17f3d488, rho=0x607a68) at eval.c:661
#8 0x00007ffff790a940 in GetObject (cptr=<optimized out>, cptr=<optimized out>) at objects.c:82
#9 0x00007ffff790b8e2 in do_usemethod (call=0x887498, op=<optimized out>, args=0x887460, env=<optimized out>)
at objects.c:449
#10 0x00007ffff78c462a in bcEval (body=body at entry=0x8874d0, rho=rho at entry=0x17f3d5...
2016 Mar 27
2
sys.function(0)
As I understand
https://stat.ethz.ch/R-manual/R-devel/library/base/html/sys.parent.html
sys.function(n) returns the function associated with stack frame n.
Since frame 0 is defined as .GlobalEnv which is not associated with a
function, I would expect this to always return NULL. However, it does not:
> sys.function()
NULL
> f <- function(x) sys.function(x)
> f(0)
function(x)
2011 Aug 14
0
Improved version of Rprofmem
...*************/
-#ifndef R_MEMORY_PROFILING
-
-SEXP attribute_hidden do_Rprofmem(SEXP call, SEXP op, SEXP args, SEXP rho)
+static void R_OutputStackTrace (void)
{
- error(_("memory profiling is not available on this system"));
- return R_NilValue; /* not reached */
-}
+ RCNTXT *cptr;
+ int newline;
-#else
-static int R_IsMemReporting; /* Rboolean more appropriate? */
-static FILE *R_MemReportingOutfile;
-static R_size_t R_MemReportingThreshold;
+ newline = R_MemReportingToTerminal | R_MemDetailsReporting;
-static void R_OutputStackTrace(FILE *file)
-{
- int newli...
1998 May 15
1
couldn't find function "print.tframe"
I have an object with an attribute "tframe" for which there is a generic method
print.tframe and also a method print.tframe.default defined in a library.
However, when I use attributes(object) I get the message
$tframe
Error: couldn't find function "print.tframe"
It's as if <primitive: attributes> is not looking through the search list?
Any suggestions?
2000 Jan 27
1
Long awaited round 1 of NeXT patches.
...repository. I believe it comes
+ * from Thomas Funke <thf at zelator.in-berlin.de>. Includes
+ * some mods from Garance Drosehn <gad at eclipse.its.rpi.edu>.
+ */
+#if !defined(HAVE_SETENV) && !defined(HAVE_PUTENV)
+int putenv(char *s)
+{
+ int nlen;
+ char *cptr;
+ char **nenv, **eptr;
+ extern char **environ;
+
+ /* first see if there is any environment setup. If not,
+ * create it with this single variable in it.
+ */
+ if (environ == NULL) {
+ nenv = (char **) malloc(2 * sizeof(char *));
+ if (nenv == NULL)
+ return -1;
+ envi...