search for: text_vfprintf

Displaying 5 results from an estimated 5 matches for "text_vfprintf".

Did you mean: test_vsprintf
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
2005 Aug 22
2
RFC: "loop connections"
...ue); } -static void outtext_destroy(Rconnection con) +static void outloop_destroy(Rconnection con) { - Routtextconn this = (Routtextconn)con->private; + Routloopconn this = (Routloopconn)con->private; free(this->lastline); free(this); } @@ -1765,7 +1802,7 @@ static int text_vfprintf(Rconnection con, const char *format, va_list ap) { - Routtextconn this = (Routtextconn)con->private; + Routloopconn this = (Routloopconn)con->private; char buf[BUFSIZE], *b = buf, *p, *q, *vmax = vmaxget(); int res = 0, usedRalloc = FALSE, buffree, already = strlen(this-&gt...
2005 Sep 18
0
Updated rawConnection() patch
...this, int need) +{ + SEXP tmp = this->data; + int len = length(tmp); + if (this->len + need > len) { + this->data = lengthgets(tmp, len + need + (len>>3) + 16); + R_PreserveObject(this->data); + R_ReleaseObject(tmp); + } +} + #define LAST_LINE_LEN 256 static int text_vfprintf(Rconnection con, const char *format, va_list ap) @@ -1803,7 +1841,6 @@ char buf[BUFSIZE], *b = buf, *p, *q, *vmax = vmaxget(); int res = 0, usedRalloc = FALSE, buffree, already = strlen(this->lastline); - SEXP tmp; if(already >= BUFSIZE) { /* This will fail so just cal...
2005 Aug 17
0
Raw data type transformations
...nections, it appears that all that needs to be done is to add support for filling the internal buffer from a raw vector (a few lines of code), and adding a text_read() function (again just a few lines). For output, text_write() is similarly simple, and a few lines of code would need to be added to text_vfprintf() to handle copying to a raw vector in place of a character vector. The text_* functions would then probably be better named internal_* since they would handle internal binary as well as internal text connections. Does this sound like it would be a useful capability? -- David Hinds
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