search for: closxp

Displaying 20 results from an estimated 26 matches for "closxp".

2011 Nov 07
1
Accessing ENVSXP and CLOSXP while processing parsed R code
...Abstract syntax tree(AST). I would like to include the information about closure/environments in my AST so that I can possibly do some optimizations. My question is, how can I get hold of this information? One thing I noticed while 'walking' through the parser output, I never encounter a CLOSXP (which I check using TYPEOF()) , even though in the above code, closure is created. Is it the case that this information is meant just for the internal "eval*" function and not exposed application writers? Thanks, Rob [[alternative HTML version deleted]]
2006 Jun 03
3
More on bug 7924
...gengc_prev_node = 0x8442b8, u = {primsxp = { offset = 2}, symsxp = {pname = 0x2, value = 0x230002acc2, internal = 0x21000090}, listsxp = {carval = 0x2, cdrval = 0x230002acc2, tagval = 0x21000090}, envsxp = {frame = 0x2, enclos = 0x230002acc2, hashtab = 0x21000090}, closxp = {formals = 0x2, body = 0x230002acc2, env = 0x21000090}, promsxp = {value = 0x2, expr = 0x230002acc2, env = 0x21000090}}} #0 DEBUG_SET_NAMED (x=0x85cfd8, v=2) at ../../../r-devel/r-devel/ R/src/main/main.c:1444 #1 0x00002aaaaab67b04 in Rf_eval (e=0x570348, rho=0x9eb5f0)...
2016 May 20
2
identical on closures
..."det", asNamespace("Matrix")), ignore.environment=T) [1] TRUE I've looked at the code in identical.c and for closures it seems to compare the FORMALS and the BODY_EXPR, so why does the first example not return TRUE as surely the formals and body are identical? case CLOSXP: return(R_compute_identical(FORMALS(x), FORMALS(y), flags) && R_compute_identical(BODY_EXPR(x), BODY_EXPR(y), flags) && (IGNORE_ENV || CLOENV(x) == CLOENV(y) ? TRUE : FALSE) && (IGNORE_BYTECODE || R_compute_identical(BODY(x), BODY(y),...
2003 Dec 16
1
Memory issues in "aggregate" (PR#5829)
...ation, list(Delta), length) > colnames(pseudo.hist) <- c("Delta", "N") > detach(profiles) > gc() used (Mb) gc trigger (Mb) Ncells 701188 18.8 2683553 71.7 Vcells 1447712 11.1 8201413 62.6 > memory.profile() NILSXP SYMSXP LISTSXP CLOSXP ENVSXP PROMSXP LANGSXP 1 7228 244243 3949 495 773 113819 SPECIALSXP BUILTINSXP CHARSXP LGLSXP INTSXP 207 1177 283663 4661 0 0 49 REALSXP CPLXSXP STRSX...
2001 Dec 07
2
Memory problem
Dear all, I have written a little R program to convert images. See below. Within the loop over j (the filenames) memory consumption grows constantly. rm( ... ) inside the loop did not help. Memory does not grow if I remove the writeBin statements between the two #-------- marks. But obviously this is not solution I want... Thanks for any advice. Manfred Baumstark P.S. As I'm new to R:
2002 Oct 14
1
R 1.6.0 Solaris crash with xmalloc: out of virtual memory
...ajor 1 minor 6.0 year 2002 month 10 day 01 language R ----------------- At the beginning ------------- --- gc() returns: used (Mb) gc trigger (Mb) Ncells 254150 6.8 467875 12.5 Vcells 408499 3.2 886807 6.8 --- memory.profile() returns: NilSXP SymSXP ListSXP CloSXP EnvSXP PromSXP LangSXP SpecialSXP 1 4919 128880 1440 13 18 63607 59 BUILTINSXP CHARSXP LGLSXP - - INTSXP REALSXP CPLXSXP STRSXP 513 37178 1712 0 0 237 9047 8 10201 DOTSXP ANYSXP VECSXP EXPRSXP - EXTPTRSXP WEAKREFSXP 1 0 341...
2016 May 20
2
identical on closures
Specifically, the srcfile attribute of the srcref attribute of the two instances of the functions contain different environments, AFAICT. Environments are compared only by exact pointer, so this forces return FALSE. Snippets from .Internal(inspect(x)) and .Internal(inspect(y)): @cca008 03 CLOSXP g0c0 [MARK,NAM(2),ATT] FORMALS: @604b58 00 NILSXP g0c0 [MARK,NAM(2)] BODY: @cc9650 06 LANGSXP g0c0 [MARK,ATT] @604998 01 SYMSXP g0c0 [MARK,LCK,gp=0x5000] "{" (has value) ATTRIB: @cc9570 02 LISTSXP g0c0 [MARK] TAG: @60dd70 01 SYMSXP g0c0 [MARK,LCK,gp=0x4000] "srcre...
2014 Aug 22
1
what are labels in struct sxpinfo_struct from Rinternals.h mean?
Dear Rdevelers, ? ? ?The following struct is in the Rinternals.h. I want to know ?the meanings of labels or names like "gp,mark,obj,named,trace....." . TKS! struct sxpinfo_struct { ? ? SEXPTYPE type ? ? ?: ?5;/* ==> (FUNSXP == 99) %% 2^5 == 3 == CLOSXP ? ? * -> warning: `type' is narrower than values ? ? * ? ? ? ? ? ? ?of its type ? ? * when SEXPTYPE was an enum */ ? ? unsigned int obj ? : ?1; ? ? unsigned int named : ?2; ? ? unsigned int gp ? ?: 16; ? ? unsigned int mark ?: ?1; ? ? unsigned int debug : ?1; ? ? unsigned int tra...
2009 Jun 25
1
R data inspection under gdb?
...8, gengc_next_node = 0xa82328, gengc_prev_node = 0xa822c8, u = {primsxp = {offset = 1}, symsxp = { pname = 0x1, value = 0x146fb50, internal = 0x2000000a}, listsxp = {carval = 0x1, cdrval = 0x146fb50, tagval = 0x2000000a}, envsxp = {frame = 0x1, enclos = 0x146fb50, hashtab = 0x2000000a}, closxp = {formals = 0x1, body = 0x146fb50, env = 0x2000000a}, promsxp = {value = 0x1, expr = 0x146fb50, env = 0x2000000a}}} which suggests to me that x is not "void" (whatever that's supposed to mean here). What I'd like to do is print out SEXP's the way that the R interacti...
2001 Sep 16
1
Using closures in libraries
...closure environments by the global environment. One way around this would be to do the replacement only for closures that have the same environment as the package environment. Basically change the relevant lines in envir.c (do_libfixup) with - while (p != R_NilValue) { if (TYPEOF(CAR(p)) == CLOSXP && CLOENV(CAR(p)) != lib) SET_CLOENV(CAR(p), env); p = CDR(p); } In case any one wonders, I know I could wrap the function in a list and call the function with foo[[1]]() - but it really does not look very natural. Closures are often so useful that it is desirable that they can be...
2005 Jan 03
2
Memory problem ... Again
...te vector of size 594075 Kb > gc() used (Mb) gc trigger (Mb) Ncells 797971 21.4 1710298 45.7 Vcells 76716794 585.4 305954055 2334.3 ... > mem.limits() nsize vsize NA NA > object.size(Data) [1] 608355664 > memory.profile() NILSXP SYMSXP LISTSXP CLOSXP ENVSXP PROMSXP LANGSXP 1 30484 372383 4845 420 180 127274 SPECIALSXP BUILTINSXP CHARSXP LGLSXP INTSXP 203 1168 111430 5296 0 0 44650 REALSXP CPLXSXP STRSXP...
2004 Dec 28
2
Configuration of memory usage
...ues: liwong normalizing...Error: cannot allocate vector of size 594075 Kb > gc() used (Mb) gc trigger (Mb) Ncells 797983 21.4 1710298 45.7 Vcells 76716811 585.4 305954068 2334.3 > object.size(Data) [1] 608355664 > memory.profile() NILSXP SYMSXP LISTSXP CLOSXP ENVSXP PROMSXP LANGSXP 1 30484 372373 4845 420 180 127274 SPECIALSXP BUILTINSXP CHARSXP LGLSXP INTSXP 203 1168 111434 5296 0 0 44649 REALSXP CPLXSXP STRSXP...
2009 Dec 16
2
What is the fastest way to see what are in an RData file?
Currently, I load the RData file then ls() and str(). But loading the file takes too long if the file is big. Most of the time, I only interested what the variables are in the the file and the attributes of the variables (like if it is a data.frame, matrix, what are the colnames/rownames, etc.) I'm wondering if there is any facility in R to help me avoid loading the whole file.
2001 Oct 09
0
RE: [R] List of functions with debug() and trace()
...c/main/debug.c R-1.3.1/src/main/debug.c 74a75,95 > > > SEXP do_isdebug(SEXP call, SEXP op, SEXP args, SEXP rho) > { > SEXP ans; > > checkArity(op,args); > find_char_fun > > PROTECT(ans = allocVector(LGLSXP, 1)); > > if (TYPEOF(CAR(args)) != CLOSXP) > LOGICAL(ans)[0] = 0; /* False if not function */ > else > LOGICAL(ans)[0] = DEBUG(CAR(args)); > > UNPROTECT(1); > > return ans; > } > diff -r R-1.3.1-orig//src/main/names.c R-1.3.1/src/main/names.c 107a108 > {"isdebug", do_isdeb...
2010 Jan 14
1
how to call a function from C
Hi, In Rcpp, we now have a "Function" class to encapsulate functions (they cover all three kinds, but this may change). To call the function, what we do is generate a call with the function as the first node and then evaluate the call. SEXP stats = PROTECT( R_FindNamespace( mkString( "stats") ) ); SEXP rnorm = PROTECT( findVarInFrame( stats, install( "rnorm") ) )
1998 Jul 01
4
R-beta: R-0.62.1 under Digital Unix
I am grateful for the advice of Douglas Bates on my earlier problem in making R-0.62.1, but I'm afraid I'm still having problems.... I have been installing the various updates to R for quite some time on my alpha, and it is only now that I have been having really severe problems. The three or 4 versions before 0.61.1 installed without error. For 0.61.1 I needed to install GNU make. For
2006 Jun 02
2
Helping out - simple bugs to help familiarize with R design, source, etc
Hi All, Well I finally have found the time to get svn working and I have successfully built my own tuned atlas (multi-threaded version) libs and have both the r-devel and r-patched trees building daily on my box. The problem is I still do not have a good idea of the layout and design of R, and typically I "learn by doing" by trying to fix a bug that hits me. Unfortunately ;-)
2008 Aug 07
1
dput function (PR#12112)
Full_Name: Juan Gea Version: R version 2.6.2 OS: Fedora Core 6 Submission from: (NULL) (79.153.48.49) Abort: objeS <- matrix("AAA",1000000) class(objeS) outTxt <- textConnection("vaClob", open = "w", local = FALSE) dput(objeS,outTxt) close(outTxt) R version 2.6.2 (2008-02-08) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN
2002 Aug 06
2
Memory leak in R v1.5.1?
...16.1 Vcells 467858 3.6 1310720 10.0 20.0 > rm(list = ls(all = TRUE)) > gc() used (Mb) gc trigger (Mb) limit (Mb) Ncells 554338 14.9 565000 15.1 16.1 Vcells 467858 3.6 1310720 10.0 20.0 > memory.profile() NILSXP SYMSXP LISTSXP CLOSXP ENVSXP PROMSXP LANGSXP 1 5031 264110 1401 16047 0 60670 SPECIALSXP BUILTINSXP CHARSXP LGLSXP INTSXP 59 503 29179 1682 0 0 24 REALSXP CPLXSXP STRSXP DOT...
2008 Apr 29
2
reproducible segmentation fault caused by textConnection()
Dear all, It seems that textConnection() can trigger a segmentation fault. The following script (using two large loops) makes this bug reproducible: for (i in 1:10000) { z=textConnection(NULL,open='w') for (j in 1:100) { write(runif(1)*1e6,file=z) write('\n',file=z) } close(z) } The bug could be reproduced on R-2.6.1, R-2.7.0 and on the latest R-devel