Message-Id: <199707280946.LAA22650@hera.hu.bonus.com> From: "Gyorgy Abonyi" To: , "Chirayu Krishnappa" Subject: Re: mem alloc taking up power of 2 Date: Mon, 28 Jul 1997 11:46:33 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Precedence: bulk Chirayu Krishnappa 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