Displaying 20 results from an estimated 3000 matches similar to: "malloc/calloc/strdup and R's aequivalents"
2006 Apr 13
2
Calloc : syntax error
Hi,
I have issue with Calloc : at the compilation step, gcc tells "error :
syntax error before ')' token".
When I use the classical C calloc... free, everything's fine.
Here's the part of code :
a = (double*) Calloc(*n,sizeof(double));
when i remove this line or replace it with the calloc, it's ok
Hint : In the header file R.h, there's a line :
/* for PROBLEM
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,
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));
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
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 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
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
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
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
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);
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
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
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:
>>>>
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’
2016 Oct 03
3
Default alignment for 'malloc'
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' always return a pointer to memory that is
aligned to a particular boundary?
Related too, is it possible to specify that the stack pointer always points
to memory which is aligned to a
2009 Jan 12
2
[LLVMdev] malloc vs malloc
On Jan 11, 2009, at 11:22 AM, Chris Lattner wrote:
>>> There is no good reason for malloc to be an instruction anymore.
>>> I'd
>>> be very happy if it got removed. Even if we keep it, malloc/alloca
>>> should be extended to optionally take 64-bit sizes.
>>
>> I'm curious. Do we want to keep the free instruction?
>
> No,
2015 Mar 31
2
[LLVMdev] why we assume malloc() always returns a non-null pointer in instruction combing?
Hi,
When looking into the bug in https://llvm.org/bugs/show_bug.cgi?id=21421, I
found a regression test in Transforms/InstCombine/malloc-free-delete.ll
against me to directly fix it. The test is,
define i1 @foo() {
; CHECK-LABEL: @foo(
; CHECK-NEXT: ret i1 false
%m = call i8* @malloc(i32 1)
%z = icmp eq i8* %m, null
call void @free(i8* %m)
ret i1 %z
}
According to
2009 Jan 12
0
[LLVMdev] malloc vs malloc
On Jan 12, 2009, at 8:24 AM, Dan Gohman wrote:
>
> On Jan 11, 2009, at 11:22 AM, Chris Lattner wrote:
>
>>>> There is no good reason for malloc to be an instruction anymore.
>>>> I'd
>>>> be very happy if it got removed. Even if we keep it, malloc/alloca
>>>> should be extended to optionally take 64-bit sizes.
>>>
>>>
2011 May 07
3
You don't check for malloc failure
Hi,
> On Fri, 2011-04-29 at 09:05 +0200, Peter J. Philipp wrote:
>> You don't check for malloc failure. I've made a patch that is possibly
>> wrong but it saves the program from SIGSEGV and replaces it with SIGABRT.
On Fri, 29 Apr 2011, Philipp Schafft wrote:
> But I have a question:
> Not all of them (only had a brief look at the patch) look to be in a
>
2015 Mar 31
2
[LLVMdev] why we assume malloc() always returns a non-null pointer in instruction combing?
> I think we can do such optimization with operator new, because new never returns null.
This is incorrect in the case of `new (std::nothrow) ...` - the whole
point of `(std::nothrow)` is to tell new that it should return NULL in
case of failure, rather than throw an exception (bad_alloc).
But the point here is not the actual return value, but the fact that
the compiler misses that the