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

2011-08-21 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 Anthony Liguori
On 08/21/2011 02:17 AM, Blue Swirl wrote: On Sun, Aug 21, 2011 at 3:11 AM, Anthony Liguori wrote: On 08/20/2011 01:59 AM, Blue Swirl wrote: On Fri, Aug 19, 2011 at 3:22 PM, Avi Kivitywrote: On 08/18/2011 09:54 PM, Peter Maydell wrote: On 18 August 2011 18:48, Avi Kivity wrote:

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 wrote: > On 08/20/2011 01:59 AM, Blue Swirl wrote: >> >> On Fri, Aug 19, 2011 at 3:22 PM, Avi Kivity  wrote: >>> >>> On 08/18/2011 09:54 PM, Peter Maydell wrote: On 18 August 2011 18:48, Avi Kivity    wrote: > >  +static GMemVTable

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 Kivity 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-20 Thread Anthony Liguori
On 08/20/2011 01:59 AM, Blue Swirl wrote: On Fri, Aug 19, 2011 at 3:22 PM, Avi Kivity wrote: On 08/18/2011 09:54 PM, Peter Maydell wrote: On 18 August 2011 18:48, Avi Kivitywrote: +static GMemVTable gmemvtable = { +.malloc = qemu_malloc, +.realloc = qemu_realloc, +.fr

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 wrote: > On 08/18/2011 09:54 PM, Peter Maydell wrote: >> >> On 18 August 2011 18:48, Avi Kivity  wrote: >> >  +static GMemVTable gmemvtable = { >> >  +    .malloc = qemu_malloc, >> >  +    .realloc = qemu_realloc, >> >  +    .free = qemu_free, >> >  +};

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 Kivity wrote: > +static GMemVTable gmemvtable = { > +.malloc = qemu_malloc, > +.realloc = qemu_realloc, > +.free = qemu_free, > +}; > + > +/** > + * qemu_malloc_init: initialize memory management > + *

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 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_v

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 wrote: > This makes the tracing infrastructure available to users of g_new(). > > Signed-off-by: Avi Kivity > --- >  qemu-common.h |    1 + >  qemu-malloc.c |   15 +++ >  vl.c          |    1 + >  3 files changed, 17 insertions(+), 0 deletio

[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 --- 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 index 74d5c4b..fb