From patchwork Thu Dec 9 11:09:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 74915 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A2A02B6F14 for ; Fri, 10 Dec 2010 02:52:58 +1100 (EST) Received: from localhost ([127.0.0.1]:38870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQinf-0003g7-S9 for incoming@patchwork.ozlabs.org; Thu, 09 Dec 2010 10:52:55 -0500 Received: from [140.186.70.92] (port=44570 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQeN7-0006Gl-No for qemu-devel@nongnu.org; Thu, 09 Dec 2010 06:09:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQeN6-0000GJ-JU for qemu-devel@nongnu.org; Thu, 09 Dec 2010 06:09:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:23465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQeN6-0000GD-Ae for qemu-devel@nongnu.org; Thu, 09 Dec 2010 06:09:12 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB9B97DU008815 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 Dec 2010 06:09:07 -0500 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oB9B91no014178; Thu, 9 Dec 2010 06:09:06 -0500 From: Kevin Wolf To: anthony@codemonkey.ws Date: Thu, 9 Dec 2010 12:09:58 +0100 Message-Id: <1291893010-29223-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1291893010-29223-1-git-send-email-kwolf@redhat.com> References: <1291893010-29223-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 02/14] Add missing tracing to qemu_mallocz() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jes Sorensen Signed-off-by: Jes Sorensen Signed-off-by: Kevin Wolf --- qemu-malloc.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/qemu-malloc.c b/qemu-malloc.c index 28fb05a..b9b3851 100644 --- a/qemu-malloc.c +++ b/qemu-malloc.c @@ -64,10 +64,13 @@ void *qemu_realloc(void *ptr, size_t size) void *qemu_mallocz(size_t size) { + void *ptr; if (!size && !allow_zero_malloc()) { abort(); } - return qemu_oom_check(calloc(1, size ? size : 1)); + ptr = qemu_oom_check(calloc(1, size ? size : 1)); + trace_qemu_malloc(size, ptr); + return ptr; } char *qemu_strdup(const char *str)