This is the mail archive of the
mailing list for the binutils project.
Re: [RFA] rda/samples: improve memory allocation
- From: Michael Snyder <msnyder at redhat dot com>
- To: Michael Elizabeth Chastain <mec dot gnu at mindspring dot com>
- Cc: binutils at sources dot redhat dot com, cagney at gnu dot org, gdb-patches at sources dot redhat dot com, rda at sources dot redhat dot com
- Date: Mon, 12 Jul 2004 23:50:40 +0000
- Subject: Re: [RFA] rda/samples: improve memory allocation
- Organization: Red Hat, Inc.
- References: <20040710032623.15A4D4B104@berman.michael-chastain.com>
Michael Elizabeth Chastain wrote:
Michael Snyder writes:
+ #define ALLOC_UNIT 0x1000;
Oops, extra semicolon!
+ #define alloc_roundup(LEN) ((LEN / ALLOC_UNIT) + ALLOC_UNIT)
This looks like it's missing a multiplication again by ALLOC_UNIT.
Say, if LEN is 0x3000, then alloc_roundup(LEN) comes out to 0x1003
which seems weird.
#define alloc_roundup(LEN) ((((LEN)+ALLOC_UNIT-1) / ALLOC_UNIT) * ALLOC_UNIT)
Or I dunno exactly what you want, but that definition doesn't look
right. Looks like a missing call to alloc_coffee somewhere ...
Mmm, for some reason, I've always been roundup-challenged.
Withdrawn and re-submitted, with your suggestions. Thanks.
[msnyder@dhcp-172-16-25-160 samples]$ make coffee
make: *** No rule to make target `coffee'. Stop.