From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW() Date: Mon, 25 Jul 2011 16:51:27 +0200 Message-ID: <4E2D82EF.4020606@redhat.com> References: <1311583872-362-1-git-send-email-avi@redhat.com> <4E2D5D7C.40208@codemonkey.ws> <4E2D5F0D.2040303@redhat.com> <4E2D5FB3.7000906@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , Avi Kivity , qemu-devel@nongnu.org, kvm@vger.kernel.org To: Blue Swirl Return-path: Received: from mail-yx0-f174.google.com ([209.85.213.174]:48600 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113Ab1GYOve (ORCPT ); Mon, 25 Jul 2011 10:51:34 -0400 Received: by yxi11 with SMTP id 11so2270614yxi.19 for ; Mon, 25 Jul 2011 07:51:33 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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 g_malloc uses qemu_malloc => you keep and expand tracepoints, you lose the very nicely tuned allocator 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...). Paolo