Displaying 20 results from an estimated 10000 matches similar to: "Calloc : syntax error"
2012 Mar 18
2
malloc/calloc/strdup and R's aequivalents
Hello,
when looking at "Writing R Extensions"
with mem-allocation in mind, I wondered,
which functions to use to substitute
malloc(), calloc(), realloc() and strdup() and free().
It looked like Calloc() or R_Calloc() might be useful for
some of my tasks, but when trying to use R_Calloc() for example,
I got some error messages which I don't see where they are coming from.
Maybe I
2005 Dec 29
1
Problems with calloc function.
Hi all,
I have a C code in Linux, it has 7 pointers and compile e run OK, but when I
run in R happens problems with calloc function, it returns NULL.
###############################################
> int *temp1,*temp2,*temp3,*temp4;
temp1 = (int *)calloc(col,sizeof(int));
if(temp1 == NULL){
printf("\n\n No Memory1!");
exit(1);
}
temp2 = (int *)calloc(col,sizeof(int));
2024 Aug 13
1
[PATCH] Reorder calloc arguments
Reordering calloc arguments silences gcc compiler warnings of
latest versions. Spotted with OpenSSH-portable on a Linux system.
Okay?
Index: cipher.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/cipher.c,v
diff -u -p -u -p -r1.121 cipher.c
--- cipher.c 17 May 2024 02:39:11 -0000 1.121
+++ cipher.c 13 Aug 2024 16:46:00 -0000
@@ -249,7 +249,7
2015 Jun 17
2
[PATCH] btrfs: keep calloc and its error message match
commit 3f4ba2e98d21746723d291939ccc2e1f1526aa6d
left some error messages unchanged.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
---
daemon/btrfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 7b14bac..e8059db 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -479,7 +479,7 @@ do_btrfs_subvolume_list (const
2006 Apr 17
1
[patch] calloc arguments
Hi, it looks like a few users of calloc had their arguments backwards. I
checked the other users and they seem fine.
Since one of those is in ioemu code, does that mean we (I?) will be
submitting that bug to qemu upstream?
--
Hollis Blanchard
IBM Linux Technology Center
Fix swapped calloc() arguments.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
diff -r c4eead8a925b
2015 Aug 27
2
[Mesa-dev] gallium state tracker calls calloc for 0 sizes arrays ?
Hi,
On 27-08-15 15:46, Marek Olšák wrote:
> On Thu, Aug 27, 2015 at 3:09 PM, Hans de Goede <hdegoede at redhat.com> wrote:
>> Hi All,
>>
>> While debugging: https://bugzilla.redhat.com/show_bug.cgi?id=1008089
>>
>> I made a apitrace recording of the a single slide transition
>> animation, and since I suspected memory corruption replayed
>> it
2015 Aug 27
2
gallium state tracker calls calloc for 0 sizes arrays ?
Hi All,
While debugging: https://bugzilla.redhat.com/show_bug.cgi?id=1008089
I made a apitrace recording of the a single slide transition
animation, and since I suspected memory corruption replayed
it using ElectrFence + glretrace, this finds a 0 sized array
allocation at src/mesa/state_tracker/st_glsl_to_tgsi.cpp: 5565:
if (proginfo->Parameters) {
t->constants = (struct
2009 Nov 03
1
hivex.c: unchecked calloc
Hi Rich,
There's an unchecked calloc in hivex.c's hive_open:
h->bitmap = calloc (1 + h->size / 32, 1);
...
This subsequent deref could cause a segfault:
BITMAP_SET (h->bitmap, blkoff);
2015 Aug 27
3
[Mesa-dev] gallium state tracker calls calloc for 0 sizes arrays ?
On Thu, Aug 27, 2015 at 1:59 PM, Alex Deucher <alexdeucher at gmail.com> wrote:
> On Thu, Aug 27, 2015 at 1:55 PM, Hans de Goede <hdegoede at redhat.com> wrote:
>> Hi,
>>
>> On 27-08-15 15:46, Marek Olšák wrote:
>>>
>>> On Thu, Aug 27, 2015 at 3:09 PM, Hans de Goede <hdegoede at redhat.com>
>>> wrote:
>>>>
2009 Jul 20
3
S_alloc or Calloc for return value
I am trying to write a C function to create a vector of integers that can be
used by the R calling function. I do not know the size of the vector in the
R calling function. (Well, actually, I have an upper limit on the size, but
that is so large that R cannot allocate it. What I'm doing in the function
is to do a sieving procedure, and the result will be small enough to fit
into my
2009 Nov 03
2
R 2.10.0: Error in gsub/calloc
I'm running R 2.10.0 under Mac OS X 10.5.8; however, I don't think this
is a Mac-specific problem.
I have a very large (158,908 possible sentences, ca. 58 MB) plain text
document d which I am
trying to tokenize: t <- strapply(d, "\\w+", perl = T). I am
encountering the following error:
Error in base::gsub(pattern, rs, x, ...) :
Calloc could not allocate (-1398215180 of
2000 Sep 07
1
Calloc() & Free() in different .C(.) calls --> not usable ?
[sending this to R-devel, since it may be of general interest and
could possibly lead to better instructions in the "R-exts" manual]
Is this another case where only .Call() or .External() [or a fudge factor]
solve my problem?
Following situation:
I use dyn.loaded C code to compute a recursive tree structure from my data.
Beforehand I don't know how big the tree will
2020 Jun 07
3
[External] Re: use of the tcltk package crashes R 4.0.1 for Windows
On Sun, Jun 7, 2020 at 5:53 PM <luke-tierney at uiowa.edu> wrote:
>
> On Sun, 7 Jun 2020, peter dalgaard wrote:
>
> > So this wasn't tested for a month?
> >
> > Anyways, Free() is just free() with a check that we're not freeing a null pointer, followed by setting the pointer to NULL. At that point of tcltk.c, we have
> >
> > for (objc = i = 0;
2020 Jun 07
4
[External] Re: use of the tcltk package crashes R 4.0.1 for Windows
I've committed the change to use Free instead of free in tcltk.c and
sys-std.c (r78652 for R-devel, r78653 for R-patched).
We might consider either moving Calloc/Free out of the Windows
remapping or moving the remapping into header files so everything
seeing our header files uses our calloc/free. Either would be less
brittle that the current status.
Best,
luke
On Sun, 7 Jun 2020, peter
2015 Jun 18
1
[PATCH] error log: keep more calloc and its error messages match
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
---
cat/cat.c | 4 ++--
cat/ls.c | 4 ++--
daemon/md.c | 2 +-
daemon/stat.c | 2 +-
daemon/xattr.c | 2 +-
df/main.c | 4 ++--
edit/edit.c | 4 ++--
fish/fish.c | 6 +++---
fish/options.c | 4 ++--
inspector/inspector.c | 4 ++--
rescue/rescue.c
2015 Jun 17
0
Re: [PATCH] btrfs: keep calloc and its error message match
On Wednesday 17 June 2015 10:44:09 Chen Hanxiao wrote:
> commit 3f4ba2e98d21746723d291939ccc2e1f1526aa6d
> left some error messages unchanged.
That commit was about converting a couple of malloc+memset to calloc,
not about replacing messages in other parts. Hence, this note is wrong.
>
> Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
> ---
> daemon/btrfs.c | 4
2015 Jun 16
1
[PATCH] btrfs: use calloc instead of malloc+memset
Small optimization, and eases the code.
---
daemon/btrfs.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index f02acb1..7b14bac 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -1723,12 +1723,11 @@ do_btrfs_balance_status (const char *path)
nlines = count_strings (lines);
- ret = malloc(sizeof *ret);
+ ret = calloc (1,
2003 Dec 05
3
.C() memory allocation
I would like to retrieve a vector of integers from a call to .C(), but I
don't know its length in advance. How do I do this without making an ugly
safe guess?
My vector is called "sequences".
I am passing the argument sequences = integer(0) in the call to .C(),
then declaring the corresponding argument as int *sequences in my C code.
I tried R_alloc()ing the storage in C and
2007 Jan 30
0
calloc bug in RODBC 1.1-7 and later?
I'm trying to load Affy Annotation data from an Access database into R using
RODBC. This has worked fine for quite some time. The bug seems to be
correlated to RODBC versions 1.1-7 and later.
Works fine: R 2.2.0 with RODBC 1.1-4; R 2.3.0 or R 2.4.1 with RODBC 1.1-6
Fails: R 2.3.1 with RDOBC 1.1-7; R 2.4.1 with RODC 1.1-7 or 1.1-8
Details
=====
This works fine:
Version 2.2.0
2016 Oct 03
3
Default alignment for 'malloc'
On Mon, Oct 03, 2016 at 02:43:03PM +0200, Michael Kruse via llvm-dev wrote:
> 2016-10-03 13:55 GMT+02:00 Martin J. O'Riordan via llvm-dev
> <llvm-dev at lists.llvm.org>:
> > I am trying to implement some new alignment based optimisations in our
> > target backend, and I am wondering if there a way a target can specify that
> > ‘malloc’, ‘realloc’ and ‘calloc’