search for: allocstring

Displaying 14 results from an estimated 14 matches for "allocstring".

Did you mean: alloc_ring
2005 Mar 10
1
R_alloc with more than 2GB (PR#7721)
...1] 191481 3063 > length(a)*8 / 2^30 [1] 4.369812 but when I call R_alloc in some of my C code, I get "negative length vectors are not allowed": maxcp = 3063; n = 191481; vs = (long) maxcp * (long) n; mI = (double*) R_alloc(vs, sizeof(double)); I suspect this caused by allocString(int), which is called by R_alloc, see below. Would it be possible to have allocString take a long argument as well? These code excerpts are from R-devel_2005-03-10.tar.gz: char *R_alloc(long nelem, int eltsize) { R_size_t size = nelem * eltsize; SEXP s = allocString(size); ... } SEXP allocSt...
2005 Jul 19
2
R_AllocatePtr
...oking into Luke Tierney's R_AllocatePtr() and was left with a question about exactly when does R reclaim heap memory. Implication of 'simpleref.nw' is that one can allocate C data on the R heap, and as long as pointer object is alive, the data and pointer will remain valid. But it calls allocString() which is implemented using R_alloc(). 'Writing R Extensions" says R will reclaim memory allocated using R_alloc() at the end of the .Call(). Was the intent that its invocation be restricted to within a .Call()? Doesn't sound as though it could be used to return an SEXP from a .Call...
2005 Jul 15
3
Passing character strings from C code to R
...39;s Ret */ 3 for(i=0; i<n; i++) ret[i] = data[i]; 4 Free(data); 5 i=1; 6 if (comment) { // comment was found 7 n = strlen(comment); 8 if(n>0) { // and it actually have some length 9 Rprintf(" '%s' %i\n", comment, n); 10 PROTECT(Str = allocString(n+1)); 11 str = CHAR(STRING_ELT(Str, 0)); 12 strcpy(str, comment); 13 Rprintf(" '%s' %i\n", str, n); 14 setAttrib(Ret, install("comm"), Str); 15 i=2; 16 } 17 Free(comment); 18 } 20 UNPROTECT(i); Print statement in li...
2005 Jul 15
3
Passing character strings from C code to R
...39;s Ret */ 3 for(i=0; i<n; i++) ret[i] = data[i]; 4 Free(data); 5 i=1; 6 if (comment) { // comment was found 7 n = strlen(comment); 8 if(n>0) { // and it actually have some length 9 Rprintf(" '%s' %i\n", comment, n); 10 PROTECT(Str = allocString(n+1)); 11 str = CHAR(STRING_ELT(Str, 0)); 12 strcpy(str, comment); 13 Rprintf(" '%s' %i\n", str, n); 14 setAttrib(Ret, install("comm"), Str); 15 i=2; 16 } 17 Free(comment); 18 } 20 UNPROTECT(i); Print statement in li...
2005 Jul 15
0
[R] Passing character strings from C code to R
...ley at stats.ox.ac.uk] Sent: Friday, July 15, 2005 11:11 AM To: Tuszynski, Jaroslaw W. Cc: r-devel at stat.math.ethz.ch Subject: Re: [R] Passing character strings from C code to R Reading the posting guide would have shown you that R-help was quite inappropriate, so I have moved this to R-devel. allocString does not allocate a character vector, which is what you want to set as an attribute (not a 'string', whatever that is). (It creates a CHARSXP, a type that should not be user-visible directly and for which STRING_ELT is inappropriate.) You want something like (PROTECTS omitted): Str = all...
2007 May 25
0
Recent changes in R related to CHARSXPs
.... I think the goal is to refine things so that all CHARSXPs _are_ in the cache. At that point, strcmp calls can be replaced with pointer comparisons which should provide some nice speed ups. So part of the idea is that the way to get CHARSXPs is via mkChar or mkString and that one should not use allocString, etc. Finally, here is a comparison of time and memory for loading all the environments (hash tables) in Bioconductor's GO annotation data package. ## unpatched > gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 168891 9.1 350000 18.7 350000 18.7 Vcells...
2008 Oct 20
2
R 2.8.0 is released
...R >= 2.6.0 has given a warning.) o methods::allGenerics() is deprecated. o In package installation, SaveImage: yes is now ignored, and any use of the field will give a warning. o unserialize() no longer accepts character strings as input. o The C macro 'allocString' has been removed -- use 'mkChar' and variants. o Use of allocVector(CHARSXP ...) is deprecated and gives a warning. UTILITIES o The default for 'stylepath' in Sweave's (default) RweaveLatex driver is now FALSE rather than TRUE if SWEAV...
2008 Oct 20
2
R 2.8.0 is released
...R >= 2.6.0 has given a warning.) o methods::allGenerics() is deprecated. o In package installation, SaveImage: yes is now ignored, and any use of the field will give a warning. o unserialize() no longer accepts character strings as input. o The C macro 'allocString' has been removed -- use 'mkChar' and variants. o Use of allocVector(CHARSXP ...) is deprecated and gives a warning. UTILITIES o The default for 'stylepath' in Sweave's (default) RweaveLatex driver is now FALSE rather than TRUE if SWEAV...
2007 Oct 03
1
R-2.6.0 is released
...gettext has been updated to version 0.16.1. o There is now a global CHARSXP cache, R_StringHash. CHARSXPs are no longer duplicated and must not be modified in place. Developers should strive to only use mkChar (and mkString) for creating new CHARSXPs and avoid use of allocString. A new macro, CallocCharBuf, can be used to obtain a temporary char buffer for manipulating character data. This patch was written by Seth Falcon. o The internal equivalents of as.complex, as.double, as.integer and as.logical used to handle length-1 argument...
2007 Oct 03
1
R-2.6.0 is released
...gettext has been updated to version 0.16.1. o There is now a global CHARSXP cache, R_StringHash. CHARSXPs are no longer duplicated and must not be modified in place. Developers should strive to only use mkChar (and mkString) for creating new CHARSXPs and avoid use of allocString. A new macro, CallocCharBuf, can be used to obtain a temporary char buffer for manipulating character data. This patch was written by Seth Falcon. o The internal equivalents of as.complex, as.double, as.integer and as.logical used to handle length-1 argument...
2008 Apr 22
3
R 2.7.0 is released
...ally deprecated. o Two low-level functions using MethodsList metadata objects (mlistMetaName() and getAllMethods()) are deprecated. o Setting par(gamma=) is now deprecated, and the windows() device (the only known example) no longer allows it. o The C macro 'allocString' will be removed in 2.8.0 -- use 'mkChar', or 'allocVector' directly if really necessary. INSTALLATION o Tcl/Tk >= 8.3 (released in 2000) is now required to build package tcltk. o configure first tries TCL_INCLUDE_SPEC and TK_INCLUDE_SPEC...
2008 Apr 22
3
R 2.7.0 is released
...ally deprecated. o Two low-level functions using MethodsList metadata objects (mlistMetaName() and getAllMethods()) are deprecated. o Setting par(gamma=) is now deprecated, and the windows() device (the only known example) no longer allows it. o The C macro 'allocString' will be removed in 2.8.0 -- use 'mkChar', or 'allocVector' directly if really necessary. INSTALLATION o Tcl/Tk >= 8.3 (released in 2000) is now required to build package tcltk. o configure first tries TCL_INCLUDE_SPEC and TK_INCLUDE_SPEC...
2006 Oct 03
1
R-2.4.0 is released
...are called on the correct SEXPTYPE (or at least on a compatible one). See `Writing R Extensions' for the details and for a stricter test regime. o It is no longer possible to pass list variables to .C(DUP = FALSE): it would have given rise to obscure garbage collection errors. o allocString is now a macro, so packages using it will need to be reinstalled. o R_ParseVector was returning with object(s) protected in the parser if the status was PARSE_INCOMPLETE or PARSE_ERROR. o There is a new function Rf_endEmbeddedR to properly terminate a session started by Rf_initEmbedded...
2006 Oct 03
1
R-2.4.0 is released
...are called on the correct SEXPTYPE (or at least on a compatible one). See `Writing R Extensions' for the details and for a stricter test regime. o It is no longer possible to pass list variables to .C(DUP = FALSE): it would have given rise to obscure garbage collection errors. o allocString is now a macro, so packages using it will need to be reinstalled. o R_ParseVector was returning with object(s) protected in the parser if the status was PARSE_INCOMPLETE or PARSE_ERROR. o There is a new function Rf_endEmbeddedR to properly terminate a session started by Rf_initEmbedded...