From: Nishanth Menon <nm@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] DLMALLOC:!X86: add av_ initialization
Date: Tue, 6 Oct 2009 22:14:53 -0500 [thread overview]
Message-ID: <4ACC07AD.7070703@ti.com> (raw)
In-Reply-To: <d66caabb0910061952v75663685i4c1556040d089de9@mail.gmail.com>
Graeme Russ had written, on 10/06/2009 09:52 PM, the following:
> On Wed, Oct 7, 2009 at 1:13 PM, Nishanth Menon <nm@ti.com> wrote:
>> Remove the predefined static initialization
>> and generate the map dynamically to reduce
>> code size.
>>
>> This patch benefits were pointed out by Peter:
>> http://www.nabble.com/forum/Permalink.jtp?root=25518020&post=25523748&page=y
>>
>> Signed-off-by: Nishanth Menon <nm@ti.com>
>> Cc: Peter Tyser <ptyser@xes-inc.com>
>> Cc: Sandeep Paulraj <s-paulraj@ti.com>
>> Cc: Tom Rix <tom.rix@windriver.com>
>> ---
>> common/dlmalloc.c | 9 +++++++++
>> 1 files changed, 9 insertions(+), 0 deletions(-)
>>
>> diff --git a/common/dlmalloc.c b/common/dlmalloc.c
>> index 241db8c..25e5314 100644
>> --- a/common/dlmalloc.c
>> +++ b/common/dlmalloc.c
>> @@ -1474,6 +1474,7 @@ typedef struct malloc_chunk* mbinptr;
>>
>> #define IAV(i) bin_at(i), bin_at(i)
>>
>> +#ifdef CONFIG_X86
>> static mbinptr av_[NAV * 2 + 2] = {
>> 0, 0,
>> IAV(0), IAV(1), IAV(2), IAV(3), IAV(4), IAV(5), IAV(6), IAV(7),
>> @@ -1493,6 +1494,9 @@ static mbinptr av_[NAV * 2 + 2] = {
>> IAV(112), IAV(113), IAV(114), IAV(115), IAV(116), IAV(117), IAV(118), IAV(119),
>> IAV(120), IAV(121), IAV(122), IAV(123), IAV(124), IAV(125), IAV(126), IAV(127)
>> };
>> +#else
>> +static mbinptr av_[NAV * 2 + 2];
>> +#endif
>
> Is there any reason why X86 is treated differently? I know the previous
> patch to dlmalloc.c did, but in the end it really didn't need to and ended
> up breaking the x86 build anyway (my fault for not getting time to test it
> before it went mainline)
>
> Feel free to remove this #ifdef unless you are 100% sure it IS needed.
> Mainline x86 is broken anyway - if this change introduces another break, I
> will submit a consolidated fix soon
I dont have any rationale to retain the #ifdef.. it is ugly.. will kick
it out and send out a v3 of this patch in a short while.
>
>> void malloc_bin_reloc (void)
>> {
>> @@ -1527,6 +1531,11 @@ void *sbrk(ptrdiff_t increment)
>> */
>> void mem_malloc_init(ulong start, ulong size)
>> {
>> + u8 i;
>> + av_[0] = av_[1] = 0;
>> + for (i = 0; i < 128; i++)
>> + av_[2 + i * 2] = av_[2 + i * 2 + 1] = bin_at(i);
>> +
>> mem_malloc_start = start;
>> mem_malloc_end = start + size;
>> mem_malloc_brk = start;
>> --
>> 1.6.0.4
>
> Regards,
>
> Graeme
>
--
Regards,
Nishanth Menon
prev parent reply other threads:[~2009-10-07 3:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-07 2:13 [U-Boot] [PATCH v2] DLMALLOC:!X86: add av_ initialization Nishanth Menon
2009-10-07 2:13 ` [U-Boot] [PATCH] OMAP3: remove SZ definition in config definitions Nishanth Menon
2009-10-07 2:26 ` Paulraj, Sandeep
2009-10-07 2:52 ` [U-Boot] [PATCH v2] DLMALLOC:!X86: add av_ initialization Graeme Russ
2009-10-07 3:14 ` Nishanth Menon [this message]
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=4ACC07AD.7070703@ti.com \
--to=nm@ti.com \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.