From: Mike Frysinger <vapier@gentoo.org>
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 [thread overview]
Message-ID: <1293587823-16815-1-git-send-email-vapier@gentoo.org> (raw)
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
next reply other threads:[~2010-12-29 1:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-29 2:39 Mike Frysinger [this message]
2010-12-29 2:53 ` Joel Brobecker
2010-12-29 3:09 ` [toolchain-devel] " Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1293587823-16815-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.org \
--cc=toolchain-devel@blackfin.uclinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox