From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlM67-0000b5-0M for qemu-devel@nongnu.org; Mon, 25 Jul 2011 10:25:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlM65-0000kM-U8 for qemu-devel@nongnu.org; Mon, 25 Jul 2011 10:25:30 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:58799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlM65-0000kI-QJ for qemu-devel@nongnu.org; Mon, 25 Jul 2011 10:25:29 -0400 Received: by ywb3 with SMTP id 3so2687679ywb.4 for ; Mon, 25 Jul 2011 07:25:29 -0700 (PDT) Message-ID: <4E2D7CD7.1060707@codemonkey.ws> Date: Mon, 25 Jul 2011 09:25:27 -0500 From: Anthony Liguori 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: Avi Kivity , kvm@vger.kernel.org, qemu-devel@nongnu.org On 07/25/2011 09:23 AM, Blue Swirl wrote: > On Mon, Jul 25, 2011 at 3:21 PM, Anthony Liguori wrote: >> On 07/25/2011 07:18 AM, Avi Kivity wrote: >>> >>> On 07/25/2011 03:11 PM, Anthony Liguori wrote: >>>> >>>> On 07/25/2011 03:51 AM, Avi Kivity wrote: >>>>> >>>>> qemu_malloc() is type-unsafe as it returns a void pointer. Introduce >>>>> QEMU_NEW() (and QEMU_NEWZ()), which return the correct type. >>>> >>>> Just use g_new() and g_new0() >>>> >>> >>> These bypass qemu_malloc(). Are we okay with that? >> >> 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. Or just add tracepoints to g_malloc()... But yeah, the point is, we ought to unify to a standard library function instead of inventing our own version of everything. Regards, Anthony Liguori >