search for: reallocate

Displaying 20 results from an estimated 1248 matches for "reallocate".

2015 Jul 06
5
[PATCH] for potential memory leaks
libFLAC has several places like this: if(0 == (ptr = realloc(ptr, size))) return false; which results in memory leaks if realloc fails (the old value of ptr is lost). The patch should fix this. -------------- next part -------------- A non-text attachment was scrubbed... Name: realloc_memleak_fix.patch Type: application/octet-stream Size: 6272 bytes Desc: not available Url :
2017 Dec 26
3
Why is remalloc not marked as noalias?
Hello, According to my understanding, it seems that the result of realloc will not technically alias the original pointer. When the realloc is done in-place the reference <http://en.cppreference.com/w/c/memory/realloc> says: "The original pointer ptr is invalidated and any access to it is undefined behavior (even if reallocation was in-place)." Additionally from the C11 standard
2019 Sep 13
1
[PATCH nbdkit] common/bitmap: Don't fail on realloc (ptr, 0)
The following commands: nbdkit -fv --filter=cow memory size=512 --run 'qemu-img info $nbd' nbdkit -fv --filter=cache memory size=512 --run 'qemu-img info $nbd' both fail with: nbdkit: memory[1]: error: realloc: Success Initial git bisect pointed to commit 3166d2bcbfd2 (but I don't believe that commit is the real cause, it merely exposes the bug). The reason this
2009 Dec 21
2
Limit on number of times Realloc can be called?
Hello, I've been writing a program in C that will be called by R. I seem to have stumbled upon an odd error that seems to suggest there is a limit on the number of times "Realloc" (the R version as defined in the manual "R-extenstions" not the C version "realloc") when I try to use the following program: #include <R.h> #include <Rinternals.h> SEXP
2018 Jul 20
1
[PATCH 2/2] Fix safe_realloc_add_2op_() to free memory when reallocation fails
--- include/share/alloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/share/alloc.h b/include/share/alloc.h index 914de9ba..63878db0 100644 --- a/include/share/alloc.h +++ b/include/share/alloc.h @@ -168,7 +168,7 @@ static inline void *safe_realloc_add_2op_(void *ptr, size_t size1, size_t size2) free(ptr); return 0; } - return realloc(ptr, size2); + return
2019 Sep 15
2
[PATCH nbdkit v2] common/bitmap: Don't fail on realloc (ptr, 0)
v1 was here: https://www.redhat.com/archives/libguestfs/2019-September/msg00100.html In v2 I've changed the patch so it avoids calling realloc at all in this case. The patch is a bit longer this way. But I don't see any other alternative if we are to avoid having a "realloc wrapper" of some kind that we use everywhere, which I guess we should avoid because it makes plugins
2018 Jan 08
0
Why is remalloc not marked as noalias?
On 26 Dec 2017, at 10:13, Bhatu via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > According to my understanding, it seems that the result of realloc will not technically alias the original pointer. When the realloc is done in-place the reference says: > "The original pointer ptr is invalidated and any access to it is undefined behavior (even if reallocation was
2019 Sep 15
0
[PATCH nbdkit v2] common/bitmap: Don't fail on realloc (ptr, 0)
The following commands: nbdkit -fv --filter=cow memory size=512 --run 'qemu-img info $nbd' nbdkit -fv --filter=cache memory size=512 --run 'qemu-img info $nbd' nbdkit -fv --filter=cow null --run 'qemu-img info $nbd' all fail with: nbdkit: memory[1]: error: realloc: Success Initial git bisect pointed to commit 3166d2bcbfd2 (this is not real cause, it merely
2012 Nov 05
2
New Memory Allocation
In Syslinux-5.00, is the goal that the core and .c32 modules alike will use the same heap? There is a bug I am thinking about: - QEmu with 1024 MiB RAM - Syslinux 4.06 - .c32 can realloc() up to 1013 MiB - QEmu with 1024 MiB RAM - Syslinux 5.00-pre9 - .c32 can realloc() up to 45 MiB I am wondering if there's a maximum-allocation-size being hit, or if it's actually a bug I should look
2010 Oct 06
1
C code called from R: reallocate arrays passed as arguments?
..."switch" (with value 0 or 1) that states whether these "arguments" are really needed as arguments or not. When such switch is 0 (says "no"), the C code "feels free" to manipulate these "arguments", and in particular it tries to modify its extension (reallocate). To be clear: I define the "argument" in R: values1 <- double(size) values1 is passed as an argument in ".C". If the switch is set to 0 (says that "values1" is not a real argument), the C function tries to reallocate the pseudo-argument values1: double *tmp2 = r...
2018 Apr 30
0
[PATCH 3/4] common/qemuopts: use the old pointer as realloc pointer
Call realloc() directly with the pointer to the old data, instead of assigning it to the destination variable, and using that one. The rest of the code is the same, already properly checking for the results of realloc(), so this mostly help static code analyzers. --- common/qemuopts/qemuopts.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/qemuopts/qemuopts.c
2001 Dec 09
1
(fwd) Re: [Possible BUG]: Wine-20011108
Quoting Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>: > Pavel Tsekov <ptsekov@syntrex.com> wrote: > :> > :> Pavel Tsekov <ptsekov@syntrex.com> wrote: > :> : fixme:msvcrt:MSVCRT_signal (11 (nil)):stub > :> It seems to me like you are using builtin MSVCRT. Signal Handling is > broken > :> there. If the programm uses signal handling, it
2009 Oct 23
1
Confusion regarding allocating Matrices.
...ays require to allocate the exact number of data elements in a R Matrix? In the above code segment I have clearly exceeded the number of elements that have been allocated but my program doesn't crash. I don't find any specific R functions for reallocation incase my data set grows. How do I reallocate? Is it necessary to reallocate or is R handling the memory management for the matrix that I have allocated? Regards Abhijit Bera [[alternative HTML version deleted]]
2015 Jun 30
3
[LLVMdev] readonly and infinite loops
...ether the call to free() after the call to bar() is dead. If we know that it is reached, then we can perform heap-to-stack conversion. Also worth noting is that because we unconditionally free(a) after the call to bar(a), it would not be legal for bar(a) to call realloc on a (because if realloc did reallocate the buffer we'd end up freeing it twice when bar(a) did eventually return). > It's definitely an > optimization > we should be doing (although, correct me if I'm wrong, LLVM already > has some > form of this for very small mallocs, no?) Not that I recall, although we w...
2006 Jan 14
0
com32's realloc function
Hello list, I've been playing with com32 programs lately and I've come across a a problem with the realloc function in libcom32. The code that rounds up the size looks to be missing a '~' operator, resulting in it truncating every request to a size of 0-15 bytes. The little patch below fixes it up to match the corresponding line in malloc, which makes it work for me. K. diff
2006 Jun 25
2
Memory leak in 3.0.22?
Hi, I have just switched from FreeBSD 4.11 using 3.0.21b to NetBSD 3.0.1 using 3.0.22. With the same configuration, and the same clients, I am now seeing what appears to be some rather large memory leakage [ I am not sure if this is the fault of Samba or NetBSD ]. Eventually the process will run out of memory (machine only has 256MB of RAM) and the Windows clients (2000, SP4 and all the
2006 Nov 21
1
1.2beta1 speex_bits_pack realloc issue?
In bits.c\speex_bits_pack there is logic to reallocate the bits buffer. In that section there is a call to speex_memset_bytes which appears to wipe out all the old bytes. I found when I encoded a multi-frame message that needed less than the default 2000 bytes for bits->chars, everything worked fine. However, when I encoded a longer message that tri...
2008 Mar 05
1
SEXP size management.
Hi, Trying to decrease the size of a SEXP variable without reassigning values individually in a loop. So far, I've tried using Realloc, as the follow source demonstrates: SEXP dothis() { SEXP Rblah; PROTECT(Rblah = NEW_INTEGER(6)); int* blah = INTEGER(Rblah); blah[0] = 1; blah[1] = 2; blah[2] = 3; Realloc(Rblah, 3, INTEGER); UNPROTECT(1); return(Rblah); } According to the
2008 Dec 19
2
Using realloc to remove MAX_LISTEN_SOCKS limit on sshd.c
OpenSSH developers, I have removed the fixed, arbitrary limit on the number of ListenAddress allowed by using realloc to dynamically expand listen_socks as needed. This completely removes MAX_LISTEN_SOCKS from the source. I made this change on the version of OpenSSH shipped with CentOS 5.2, version 4.3p2. Please see the attached .c file and .diff file. Please add these changes to OpenSSH
2015 May 29
2
[PATCH 1/3] inspection: Add func for merging fs inspections
Add a new guestfs_int_merge_fs_inspections() function that merges the OS inspection information of two inspect_fs instances into one. This function is useful if the inspection information for an OS are gathered by inspecting multiple filesystems. Signed-off-by: Nikos Skalkotos <skalkoto@grnet.gr> --- src/guestfs-internal.h | 1 + src/inspect-fs.c | 115