Displaying 20 results from an estimated 600 matches similar to: "fast mkChar"
2008 Oct 28
2
A question about the API mkchar()
Hi guys,
I've got a question about the API mkchar(). I have met some difficulty
in parsing utf-8 string to mkchar() in R-2.7.0.
I was intending to parse an utf-8 string str_jan (some Japanese
characters such as?, whose utf-8 code is E381B5) to R API SEXP
mkChar(const char *name) , we only need to create the SEXP using the
string that we parsed.
Unfortunately, I found when parsing the
2004 Jun 14
5
mkChar can be interrupted
Hi,
As was discussed earlier in another thread and as documented in R-exts
.Call() should not be interruptible by Ctrl-C. However the following
code, which spends most of its time inside mkChar, turned out to be
interruptible on RH-7.3 R-1.8.1 gcc-2.96:
#include <Rinternals.h>
#include <R.h>
SEXP foo0(const SEXP nSexp) {
int i, n;
SEXP resSexp;
if (!isInteger(nSexp))
2000 Dec 18
1
1.2.0 segfault
I'm a novice with gdb but the following is the result of a segfault problem I've been
having with 1.2.0. If there is something else I should do to get more useful
information at this point, then someone please let me know.
Paul Gilbert
______
[5] /home/mfa5/gilp/zzot : R -d gdb
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General
2004 Jun 30
2
Slow IO: was [R] naive question
I believe IO in R is slow because of the way it is implemented, not
because it has to do some extra work for the user.
I compared scan() with 'what' argument set (which is, AFAIK, is the
fastest way to read a CSV file) to an equivalent C code. It turned out
to be 20 - 50 times slower.
I can see at least two main reasons why R's IO is so slow (I didn't
profile this though):
A) it
2013 Jun 27
3
Read a text file into R with .Call()
Hi,
I want to read a text file into R with .Call().
So I define some NEW_CHARACTER() to store the chracters read and use SET_STRING_ELT to fill the elements.
e.g.
PROTECT(qNames = NEW_CHARACTER(10000));
char *foo; // This foo holds the string I want.
while(foo = readLine(FN)){
SET_STRING_ELT(qNames, i, mkChar(foo)));
}
In this way, I can get the desired character from qNames. The only problem
2008 Apr 25
2
Bug in R 2.7 for over long lines (crasher+proposed fix!) (PR#11281)
OK, I am just sending it here too as it looks like r-devel at r-project.org
is not the right place:
=EF=BB=BFOn Fri, 2008-04-25 at 08:48 +0200, Soeren Sonnenburg wrote:
> While trying to fix swig & R2.7 I actually discovered that there is a
> bug in R 2.7 causing a crash (so R & swig might actually work):
>=20
> the bug is in ./src/main/gram.c line 3038:
>=20
>
2008 Apr 25
1
Bug in R 2.7 for over long lines
While trying to fix swig & R2.7 I actually discovered that there is a
bug in R 2.7 causing a crash (so R & swig might actually work):
the bug is in ./src/main/gram.c line 3038:
} else { /* over-long line */
fixthis --> char *LongLine = (char *) malloc(nc);
if(!LongLine)
error(_("unable to allocate space for source line %d"),
2010 Jan 07
1
Segfault in GetNewPage, memory.c.
Hello.
I'm still working on my OCaml-R binding and I get a segfault in the
GetNewPage() function of memory.c.
For the record, the OCaml-R binding seems to work fine with OCaml
bytecode. The segfault here is the main issue I have with OCaml native
code. OCaml-R can be found on the following links.
Source code:
http://yziquel.homelinux.org/gitweb/?p=ocaml-r.git;a=summary
2009 Jun 26
1
bug in Rf_PrintValue ?
I'm very green with R, so maybe this is not a bug, but it looks like one to
me. The following program segfaults at the second call to Rf_PrintValue().
To failure depends on the value of the y-string. E.g., if I change it from
"coverage" to, say, "COVERAGE", the segfault does not occur.
/* bug.c */
#include <stdio.h>
#include <Rinternals.h>
#include
2008 Nov 06
1
How to get the length of an UTF-8 string
Hi there,
I am intending to get the length of an UTF-8 string which contains
some Japanese characters (let's say, rstr) in R language.
I try to use the nchar(rstr) to get its length, however, it returns
the "NA" for it contains some multi-byte characters.
Is there any alternatives to return the length of this rstr?
Any suggestion is appreciated.
Long
2005 Dec 02
1
Compile error on FreeBSD 4.10 gcc 2.95.4
FYI, I tried installing ferret on my freebsd virtual server and got this:
retango# gem install ferret --include-dependencies
Attempting local installation of ''ferret''
Local gem file not found: ferret*.gem
Attempting remote installation of ''ferret''
Updating Gem source index for: http://gems.rubyforge.org
Building native extensions. This could take a while...
2004 Mar 17
1
best methods for strings and structures?
I'm trying to generate an R interface for a library that's commonly used and
I'm currently writing wrapper functions for file i/o and return an object
(list?) that contains the elements of the C structure. For example, reading
a file that contains:
struct CONFIG_RECORD
{
char coeffs_filename[256];
char species_filename[256];
unsigned long
2006 Oct 31
1
Some R questions
Hi all,
I am working with some large data sets (1-4 GB) and have some questions
that I hope someone can help me with:
1. Is there a way to turn off garbage collector from within C interface ?
what I am trying to do is suck data from mysql (using my own C
functions) and I see that allocating each column (with about 1-4 million
items) takes between 0.5 and 1 seconds. My
2005 Apr 12
5
How allocate STRSXP outside of gc
Hi,
I am trying to figure a way to allocate a string SEXP so that gc() won't
ever collect it.
Here is a little bit of a background. Suppose I want to write a
.Call-callable function that upon each call returns the same value, say
mkChar("foo"):
SEXP getFoo() {
return mkChar("foo");
}
The above implementation doesn't take advantage of the fact that
2019 Aug 02
4
Infrequent but steady NULL-pointer caused segfault in as.POSIXlt.POSIXct (R 3.4.4)
The R script I run daily for hours looks like this:
while (!finish) {
Sys.sleep(0.1)
time = as.integer(format(Sys.time(), "%H%M")) # always crash here
if (new.data.timestamp() <= time)
next
# ... do some jobs for about 2 minutes ...
gc()
}
Basically it waits for new data, which comes in every 10 minutes, and
do some jobs, then gc(), then loop again. It
2017 Oct 06
1
SIGSEGV during startup
Hi,
This problem started as of r73472 ("Merged in the rest of the basic
ALTREP framework."); I tested r73471 and it did not exist.
I'm building R devel on Ubuntu 16.04.3 LTS (64-bit), with the following flags:
CC="gcc -std=gnu99 -fsanitize=address -fno-omit-frame-pointer"
CFLAGS="-fno-omit-frame-pointer -g -O2 -Wall -pedantic -mtune=native"
and using
1998 Sep 22
1
"Segmentation Fault - core dumped" in R 0.62.3
I am occasional getting "Segmentation Fault - core dumped" in R 0.62.3 (I think
more often then I did in 0.62.2). I have not been able to do this in any
reliably reproducible way yet, but thought I would mention the problem in case
some else can isolate it.
Paul Gilbert
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read
2005 Nov 30
8
Compilation of ferret C-extension under Windows.
Hi, David.
I have recently fixed ferret C sources and successfully compile extension
with MSVC.Net The problem was that MS compiler is more stricter that GCC and
require that all variables were declared before using. There was ~30 such
declaration. I have fixed them all.
But I am not sure that it works because tests failed with following error
both on clean and patched versions. So seems that it
2019 Aug 04
1
Infrequent but steady NULL-pointer caused segfault in as.POSIXlt.POSIXct (R 3.4.4)
A reply from stackoverflow suggests I might have hit this bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=14023
I can confirm that this glibc bug affects my system (latest CentOS 7).
However, as far as I know, R is not multithreaded in its core. Is it
possible that some library triggered this?
Regards,
Steve
Tomas Kalibera <tomas.kalibera at gmail.com> ?2019?8?2??? ??4:59???
>
2003 Sep 05
1
Problem with S4 slots in C code (PR#4073)
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C3738F.63DE3390
Content-Type: text/plain;
charset="iso-8859-1"
#I want to be able to create a new S4 class and read data into it using C
code
# Here is a very simple S4 object inheriting from "array", but with 5