[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() f
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family |
Date: |
Fri, 19 Aug 2011 05:54:25 +0100 |
On 18 August 2011 18:48, Avi Kivity <address@hidden> wrote:
> +static GMemVTable gmemvtable = {
> + .malloc = qemu_malloc,
> + .realloc = qemu_realloc,
> + .free = qemu_free,
> +};
> +
> +/**
> + * qemu_malloc_init: initialize memory management
> + */
> +void qemu_malloc_init(void)
> +{
> + g_mem_set_vtable(&gmemvtable);
> +}
Does this mean you can now safely allocate with g_malloc
and free with qemu_free, or is mixing the two APIs like that
still a no-no ?
(I'm thinking about a situation where you might use a glib utility
function that returned g_malloc'd memory and want to pass that back
to your caller without having to either copy to qemu_malloc'd memory
or require your caller to care about the distinction.)
-- PMM
- [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family, Avi Kivity, 2011/08/18
- Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family, Stefan Hajnoczi, 2011/08/19
- Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family,
Peter Maydell <=
- Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family, Avi Kivity, 2011/08/19
- Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family, Blue Swirl, 2011/08/20
- Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family, Anthony Liguori, 2011/08/20
- Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family, Blue Swirl, 2011/08/21
- Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family, Anthony Liguori, 2011/08/21
- Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family, Paolo Bonzini, 2011/08/22
Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family, Anthony Liguori, 2011/08/20