From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5023 invoked by alias); 29 Dec 2010 01:57:34 -0000 Received: (qmail 4949 invoked by uid 22791); 29 Dec 2010 01:57:33 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Dec 2010 01:57:29 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 3B24A1B4030; Wed, 29 Dec 2010 01:57:27 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Cc: toolchain-devel@blackfin.uclinux.org Subject: [PATCH] sim: HW_NALLOC: new alloc helper Date: Wed, 29 Dec 2010 02:39:00 -0000 Message-Id: <1293587823-16815-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00528.txt.bz2 We have malloc (uninitialized buffer), zalloc (zeroed buffer), and nzalloc (zeroed array). But we don't have a way to allocate an uninitialized array. Add a HW_NALLOC to fill this gap. Signed-off-by: Mike Frysinger 2010-12-28 Mike Frysinger * hw-alloc.h (HW_NALLOC): Define. --- sim/common/hw-alloc.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/sim/common/hw-alloc.h b/sim/common/hw-alloc.h index 699d017..2cea44f 100644 --- a/sim/common/hw-alloc.h +++ b/sim/common/hw-alloc.h @@ -33,6 +33,7 @@ along with this program. If not, see . */ #define HW_ZALLOC(me,type) (type*) hw_zalloc (me, sizeof (type)) #define HW_MALLOC(me,type) (type*) hw_malloc (me, sizeof (type)) +#define HW_NALLOC(me,type,n) (type*) hw_malloc (me, sizeof (type) * (n)) #define HW_NZALLOC(me,type,n) (type*) hw_zalloc (me, sizeof (type) * (n)) extern void *hw_zalloc (struct hw *me, unsigned long size); -- 1.7.3.1