This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] sim: HW_NALLOC: new alloc helper
- From: Mike Frysinger <vapier at gentoo dot org>
- To: gdb-patches at sourceware dot org
- Cc: toolchain-devel at blackfin dot uclinux dot org
- Date: Tue, 28 Dec 2010 20:57:03 -0500
- Subject: [PATCH] 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 <vapier@gentoo.org>
2010-12-28 Mike Frysinger <vapier@gentoo.org>
* 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 <http://www.gnu.org/licenses/>. */
#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