Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family

2011-08-22 Thread Paolo Bonzini
On 08/21/2011 03:24 PM, Anthony Liguori wrote: There's not a lot of these but they need to be audited individual to make sure that the frees correspond to mallocs. I had patches for these in the qemu_malloc world. I'll try to apply the sed script to the patches. Paolo

Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family

2011-08-21 Thread Blue Swirl
On Sun, Aug 21, 2011 at 3:11 AM, Anthony Liguori anth...@codemonkey.ws wrote: On 08/20/2011 01:59 AM, Blue Swirl wrote: On Fri, Aug 19, 2011 at 3:22 PM, Avi Kivitya...@redhat.com  wrote: On 08/18/2011 09:54 PM, Peter Maydell wrote: On 18 August 2011 18:48, Avi Kivitya...@redhat.com    

Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family

2011-08-21 Thread Anthony Liguori
On 08/21/2011 02:17 AM, Blue Swirl wrote: On Sun, Aug 21, 2011 at 3:11 AM, Anthony Liguorianth...@codemonkey.ws wrote: On 08/20/2011 01:59 AM, Blue Swirl wrote: On Fri, Aug 19, 2011 at 3:22 PM, Avi Kivitya...@redhat.comwrote: On 08/18/2011 09:54 PM, Peter Maydell wrote: On 18 August

Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family

2011-08-20 Thread Blue Swirl
On Fri, Aug 19, 2011 at 3:22 PM, Avi Kivity a...@redhat.com wrote: On 08/18/2011 09:54 PM, Peter Maydell wrote: On 18 August 2011 18:48, Avi Kivitya...@redhat.com  wrote:  +static GMemVTable gmemvtable = {  +    .malloc = qemu_malloc,  +    .realloc = qemu_realloc,  +    .free =

Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family

2011-08-20 Thread Anthony Liguori
On 08/20/2011 01:59 AM, Blue Swirl wrote: On Fri, Aug 19, 2011 at 3:22 PM, Avi Kivitya...@redhat.com wrote: On 08/18/2011 09:54 PM, Peter Maydell wrote: On 18 August 2011 18:48, Avi Kivitya...@redhat.comwrote: +static GMemVTable gmemvtable = { +.malloc = qemu_malloc, +

Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family

2011-08-20 Thread Anthony Liguori
On 08/18/2011 12:48 PM, Avi Kivity wrote: This makes the tracing infrastructure available to users of g_new(). Signed-off-by: Avi Kivitya...@redhat.com Here's my version, adapted to a world with no qemu_malloc. Regards, Anthony Liguori --- qemu-common.h |1 + qemu-malloc.c | 15

Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family

2011-08-19 Thread Avi Kivity
On 08/18/2011 09:54 PM, Peter Maydell wrote: On 18 August 2011 18:48, Avi Kivitya...@redhat.com wrote: +static GMemVTable gmemvtable = { +.malloc = qemu_malloc, +.realloc = qemu_realloc, +.free = qemu_free, +}; + +/** + * qemu_malloc_init: initialize memory

[Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family

2011-08-18 Thread Avi Kivity
This makes the tracing infrastructure available to users of g_new(). Signed-off-by: Avi Kivity a...@redhat.com --- qemu-common.h |1 + qemu-malloc.c | 15 +++ vl.c |1 + 3 files changed, 17 insertions(+), 0 deletions(-) diff --git a/qemu-common.h b/qemu-common.h

Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family

2011-08-18 Thread Stefan Hajnoczi
On Thu, Aug 18, 2011 at 6:48 PM, Avi Kivity a...@redhat.com wrote: This makes the tracing infrastructure available to users of g_new(). Signed-off-by: Avi Kivity a...@redhat.com ---  qemu-common.h |    1 +  qemu-malloc.c |   15 +++  vl.c          |    1 +  3 files changed, 17

Re: [Qemu-devel] [PATCH] Wire g_new() and friends to the qemu_malloc() family

2011-08-18 Thread Peter Maydell
On 18 August 2011 18:48, Avi Kivity a...@redhat.com wrote: +static GMemVTable gmemvtable = { +    .malloc = qemu_malloc, +    .realloc = qemu_realloc, +    .free = qemu_free, +}; + +/** + * qemu_malloc_init: initialize memory management + */ +void qemu_malloc_init(void) +{ +