[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5] linux-user/syscall.c: malloc()/calloc() to g
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v5] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0() |
Date: |
Tue, 6 Oct 2015 15:22:16 +0100 |
On Tue, Oct 6, 2015 at 3:06 PM, Harmandeep Kaur
<address@hidden> wrote:
> Convert malloc()/ calloc() calls to g_malloc()/ g_try_malloc()/ g_new0()
>
> Using GLib functions there is no need to check return value.
> It aborts the execution if allocation fails (in most of the cases).
This explains how the glib functions work, but for the commit
description I suggest:
Commit 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c ("Use glib memory
allocation and free functions") converted qemu_malloc() to g_malloc().
malloc(3) users were not converted since they didn't go through
qemu_malloc(). All heap memory allocation should go through glib so
we can take advantage of a single memory allocator and its
debugging/tracing features. Stop using malloc(3) directly.