From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlMVP-0003bt-Mn for qemu-devel@nongnu.org; Mon, 25 Jul 2011 10:51:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlMVK-0005XS-R5 for qemu-devel@nongnu.org; Mon, 25 Jul 2011 10:51:39 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:50771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlMVK-0005X7-MT for qemu-devel@nongnu.org; Mon, 25 Jul 2011 10:51:34 -0400 Received: by yxt3 with SMTP id 3so2763398yxt.4 for ; Mon, 25 Jul 2011 07:51:33 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4E2D82EF.4020606@redhat.com> Date: Mon, 25 Jul 2011 16:51:27 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1311583872-362-1-git-send-email-avi@redhat.com> <4E2D5D7C.40208@codemonkey.ws> <4E2D5F0D.2040303@redhat.com> <4E2D5FB3.7000906@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: kvm@vger.kernel.org, Avi Kivity , qemu-devel@nongnu.org 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