From e71b81d85f8873267aa65486d34ef7c86b55821d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 29 Dec 2010 02:51:40 +0000 Subject: sim: HW_NALLOC: new alloc helper 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 --- sim/common/hw-alloc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sim/common/hw-alloc.h') 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); -- cgit v1.1