aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-12-29 02:51:40 +0000
committerMike Frysinger <vapier@gentoo.org>2010-12-29 02:51:40 +0000
commite71b81d85f8873267aa65486d34ef7c86b55821d (patch)
treeb4eb9ed5b879309301947a8e57e0cdb7040c35da
parente61ddca7faeabdba9543dd205e3f3c7e8a58020f (diff)
downloadfsf-binutils-gdb-e71b81d85f8873267aa65486d34ef7c86b55821d.zip
fsf-binutils-gdb-e71b81d85f8873267aa65486d34ef7c86b55821d.tar.gz
fsf-binutils-gdb-e71b81d85f8873267aa65486d34ef7c86b55821d.tar.bz2
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>
-rw-r--r--sim/common/ChangeLog4
-rw-r--r--sim/common/hw-alloc.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 085c1aa..f32a679 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,9 @@
2010-12-28 Mike Frysinger <vapier@gentoo.org>
+ * hw-alloc.h (HW_NALLOC): Define.
+
+010-12-28 Mike Frysinger <vapier@gentoo.org>
+
* hw-alloc.h (HW_NZALLOC): Change ME,TYPE,N to me,type,n.
2010-12-15 Mike Frysinger <vapier@gentoo.org>
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);