Mail Archives: djgpp/1998/08/31/19:03:29
On 29 Aug 98 at 16:22, Endlisnis wrote:
> Salvador Eduardo Tropea (SET) wrote:
> > Of course there are better solutions like the one used by DJ in the last
> > malloc.
> What is the better method?
If you're really interested in this I suggest you visit
http://www.delorie.com/djgpp/ and follow the link to DJ's page about
the malloc algorithms that were tested. Or go direct:
http://www.delorie.com/djgpp/malloc/
He mentions briefly some differences between the algorithms he
tried, and gives graphs showing how they perform, measured on
various scales (speed and memory efficiency IIRC). For still more
detail on the current implementation, the place to look is the
library sources; the file src/libc/ansi/stdlib/malloc.c holds the
definitions of the new malloc, realloc and free routines. Some
understanding of `sbrk' might be useful too; that's in
src/libc/crt0/crt0.s.
I think the old malloc is the one in src/libc/ansi/stdlib/bsdmallo.c
(which has plenty of comments about how it works and why it does what
it does).
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
- Raw text -