www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/31/19:03:29

Comments: Authenticated sender is <mert0407 AT sable DOT ox DOT ac DOT uk>
From: "George Foot" <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: Endlisnis <s257m AT unb DOT ca>
Date: Tue, 1 Sep 1998 00:01:22 +0000
MIME-Version: 1.0
Subject: Re: question to malloc and free
Reply-to: george DOT foot AT merton DOT oxford DOT ac DOT uk
CC: djgpp AT delorie DOT com
Message-Id: <E0zDcyV-0007ul-00@sable.ox.ac.uk>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019