Comments: Authenticated sender is From: "George Foot" To: Endlisnis Date: Tue, 1 Sep 1998 00:01:22 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT 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: Precedence: bulk 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