* [PATCH] sim: HW_NALLOC: new alloc helper
@ 2010-12-29 2:39 Mike Frysinger
2010-12-29 2:53 ` Joel Brobecker
0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2010-12-29 2:39 UTC (permalink / raw)
To: gdb-patches; +Cc: toolchain-devel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sim: HW_NALLOC: new alloc helper
2010-12-29 2:39 [PATCH] sim: HW_NALLOC: new alloc helper Mike Frysinger
@ 2010-12-29 2:53 ` Joel Brobecker
2010-12-29 3:09 ` [toolchain-devel] " Mike Frysinger
0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2010-12-29 2:53 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel
> 2010-12-28 Mike Frysinger <vapier@gentoo.org>
>
> * hw-alloc.h (HW_NALLOC): Define.
This is OK too. I assume you are planning on using this soon?
--
Joel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [toolchain-devel] [PATCH] sim: HW_NALLOC: new alloc helper
2010-12-29 2:53 ` Joel Brobecker
@ 2010-12-29 3:09 ` Mike Frysinger
0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2010-12-29 3:09 UTC (permalink / raw)
To: Joel Brobecker; +Cc: toolchain-devel, gdb-patches
On Tue, Dec 28, 2010 at 21:40, Joel Brobecker wrote:
>> 2010-12-28 Mike Frysinger <vapier@gentoo.org>
>>
>> * hw-alloc.h (HW_NALLOC): Define.
>
> This is OK too. I assume you are planning on using this soon?
it's part of a CFI driver i'm writing atm and will submit once i get
the Blackfin stuff merged
-mike
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-29 2:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-29 2:39 [PATCH] sim: HW_NALLOC: new alloc helper Mike Frysinger
2010-12-29 2:53 ` Joel Brobecker
2010-12-29 3:09 ` [toolchain-devel] " Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox