Statistics
| Branch: | Revision:

root / qemu-malloc.c @ 32902772

History | View | Annotate | Download (2.5 kB)

# Date Author Comment
236e2376 12/14/2010 04:44 pm Jes Sorensen

Add missing tracing to qemu_mallocz()

Signed-off-by: Jes Sorensen <>
Signed-off-by: Kevin Wolf <>

b152aa84 10/30/2010 11:02 am Jes Sorensen

Consolidate oom_check() functions

This consolidates the duplicated oom_check() functions, as well as
splitting them into OS dependant versions to avoid the #ifdef
grossness that was present in the old osdep.c version.

Signed-off-by: Jes Sorensen <>...

cd245a19 09/10/2010 12:22 am Stefan Hajnoczi

trace: Trace qemu_malloc() and qemu_vmalloc()

It is often useful to instrument memory management functions in order to
find leaks or performance problems. This patch adds trace events for
the memory allocation primitives.

Signed-off-by: Stefan Hajnoczi <>

893a9cb4 06/15/2010 10:41 am Christoph Hellwig

cow: stop using mmap

We don't have an equivalent to mmap in the qemu block API, so read and
write the bitmap directly. At least in the dumb implementation added
in this patch this is a lot less efficient, but it means cow can also
work on windows, and over nbd or curl. And it fixes qemu-iotests testcase...

50401022 05/29/2010 12:27 am Richard Henderson

Use calloc in qemu_mallocz.

Avoids the memset if the allocator has gotten new zeroed
storage from the operating system.

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

f8b0953b 02/23/2010 11:36 pm Markus Armbruster

Simplify qemu_realloc()

No functional change. Bonus: looks just like qemu_malloc() now.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Aurelien Jarno <>

20ff6c80 12/12/2009 03:59 pm Anthony Liguori

Do not abort on qemu_malloc(0) in production builds

qemu_malloc() does not allow size=0 to be passed in and aborts on this behavior.

Unfortunately, there is good reason to believe that within qemu, there are a
number of, so far, undetected places that assume size=0 can be safely passed....

26d64a85 05/19/2009 09:29 pm malc

Format per CODING_STYLE

Signed-off-by: malc <>

a7d27b53 05/19/2009 09:29 pm malc

Abort on attempts to allocate zero bytes

http://marc.info/?t=124267873300015&r=1&w=2

Signed-off-by: malc <>

322691a5 02/11/2009 11:00 pm aliguori

Fix qemu_realloc() (Kevin Wolf)

For qemu_realloc with size == 0 a result of NULL is perfectly fine

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6615 c046a42c-6fe2-441c-8c8c-71466251a162

62a3fe29 02/06/2009 02:19 am aliguori

Replace exit() in oom_check with abort()

So that we can get a core dump with a stack trace.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6542 c046a42c-6fe2-441c-8c8c-71466251a162

8a1d02ab 02/06/2009 12:05 am aliguori

Terminate emulation on memory allocation failure (Avi Kivity)

Memory allocation failures are a very rare condition on virtual-memory
hosts. They are also very difficult to handle correctly (especially in a
hardware emulation context). Because of this, it is better to gracefully...

ac4b0d0c 11/09/2008 02:28 am balrog

Add qemu_strndup: qemu_strdup with length limit.

Also optimise qemu_strdup by using memcpy - using pstrcpy is usually
suboptimal.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5653 c046a42c-6fe2-441c-8c8c-71466251a162

62dd234f 08/25/2008 11:03 pm blueswir1

Fix error introduced by r5044

qemu_strdup() doesn't copy a last character because of off by one error.

Signed-off-by: Gleb Natapov <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5086 c046a42c-6fe2-441c-8c8c-71466251a162

363a37d5 08/21/2008 08:58 pm blueswir1

Fix OpenBSD linker warnings

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5044 c046a42c-6fe2-441c-8c8c-71466251a162

2137b4cc 08/06/2008 11:37 am ths

Add qemu_realloc(), by Gerd Hoffmann.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4986 c046a42c-6fe2-441c-8c8c-71466251a162

17e2377a 06/09/2008 04:47 pm pbrook

Prevent guest reusing host memory allocations.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4710 c046a42c-6fe2-441c-8c8c-71466251a162