Mail Archives: djgpp/1997/07/28/05:50:26
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 -