Mail Archives: djgpp/1997/10/31/07:30:24
I want to add the following 2 things:
1.
The current malloc implementation wastes linear memory at a high rate,
but it does not do so for physical memory. Whether this linear memory
wastage has significant disadvantages depends largely on the
capabilities of the DPMI host. If that host allocates (physical-disk)
swap space for the wasted blocks, and I think most hosts do because this
is much easier to implement, linear memory may become very fast full.
This may especially become significant on systems with small hard disks.
2.
A single constant number cannot be "the" result from a speed comparison.
The results based on a single (non-realistic) test, that Doug Lea's
malloc takes about 7 times more cycles than the currently used BSD's is
not very meaningful (and maybe even not indicative).
To have a good comparison, at least, you should use malloc in a program
that allocates, frees and reallocates memory, and measure time
differences. I think a good choice would be the GNU C compiler with a
modestly large source file, but there may be others programs that are
also representative.
A regular program doesn't allocate memory in totally random chunks, nor
does it allocate all memory linearly.
--
\ Vik /-_-_-_-_-_-_/
\___/ Heyndrickx /
\ /-_-_-_-_-_-_/
- Raw text -