[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW()
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW() |
Date: |
Mon, 25 Jul 2011 17:56:23 +0300 |
On Mon, Jul 25, 2011 at 5:51 PM, Paolo Bonzini <address@hidden> wrote:
> On 07/25/2011 04:23 PM, Blue Swirl wrote:
>>
>> > Yes. We can just make qemu_malloc use g_malloc.
>>
>> It would be also possible to make g_malloc() use qemu_malloc(). That
>> way we could keep the tracepoints which would lose their value with
>> g_malloc() otherwise.
>
> qemu_malloc uses g_malloc => you keep tracepoints, you just do not trace
> memory allocated by glib
Unless the plan is to replace all qemu_malloc() calls with calls to g_malloc().
> g_malloc uses qemu_malloc => you keep and expand tracepoints, you lose the
> very nicely tuned allocator
It is replaced by libc malloc() which shouldn't be so bad either.
> The former is much less code, however it requires qemu_malloc to be always
> balanced with qemu_free (patches ready and on my github tree, won't be sent
> before KVM Forum though...).
Freeing qemu_malloc() memory with plain free() is a bug.
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), (continued)
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), Avi Kivity, 2011/07/25
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), Blue Swirl, 2011/07/25
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), Anthony Liguori, 2011/07/25
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), Max Filippov, 2011/07/25
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), Anthony Liguori, 2011/07/25
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), malc, 2011/07/25
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), Avi Kivity, 2011/07/25
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), malc, 2011/07/25
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), Avi Kivity, 2011/07/25
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), Paolo Bonzini, 2011/07/25
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(),
Blue Swirl <=
- Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW(), Paolo Bonzini, 2011/07/25