www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/28/05:50:26

Message-Id: <199707280946.LAA22650@hera.hu.bonus.com>
From: "Gyorgy Abonyi" <loop AT hu DOT bonus DOT com>
To: <djgpp AT delorie DOT com>, "Chirayu Krishnappa" <chirayu AT radiolink DOT net>
Subject: Re: mem alloc taking up power of 2
Date: Mon, 28 Jul 1997 11:46:33 +0200
MIME-Version: 1.0

Chirayu Krishnappa <chirayu AT radiolink DOT net> wrote:
> >But that's NOT correct. malloc() returns also the power of two aligned
> >block to the user.
> 
> Now that is sheer wasting of memory. I think its a very bad idea to have
> implememnted it this way (the malloc()). Do the other compilers (watcom,
> visual c++, symantec etc) do the same?

In this case (memory wasting) it looks as a bad idea, but on the other hand
this malloc algorithm is much more faster then the allgorithms used by
other commercial allgorithms. BTW it's come from the U*IX world, lota U*IX
(f.e Linux) uses this, 'cos it's fast and works well with page swapping...
Check out the malloc source code in libc, there are tons of comments about
it.

Gyorgy Abonyi Jr.
loop AT hu DOT bonus DOT com

- Raw text -


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