[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] malloc improvement
From: |
Paulo Marques |
Subject: |
Re: [avr-libc-dev] malloc improvement |
Date: |
Mon, 30 Jun 2008 11:49:09 +0100 |
User-agent: |
Thunderbird 1.5.0.14 (X11/20071210) |
Hi,
Gerben van den Broeke wrote:
[...]
Improvement:
By not only noting down the size of the smallest hole, but also noting its
addrress, the second loop is not necessary anymore.
The cost:
2 more pointers are needed (both the found hole and the hole before it must be
remembered), so it might add 4 pushes at the beginning and 4 pops at the end of
the function.
In the first loop two movw's are needed to note down the hole address, which
are executed everytime a smaller hole is found.
This seems like a nice optimization :)
However, couldn't you just save the pointer to the _previous_ hole, and
use sfp->nx to get the actual hole? This should reduce the cost a bit
and make the patch even more attractive.
--
Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
Web: www.grupopie.com
"There are 10 kinds of people in the world, those who understand
binary and those who don't"