Mail Archives: djgpp-workers/1996/06/09/20:47:54
> It looks more like a bug to me. I malloc all available memory,
> free everything and then malloc() won't work any more.
This isn't "normal" behavior. If you try to allocate the memory in the
same size blocks as you originally used, it's still available. The
problem is the current algorithm is tuned ONLY for speed. It rounds
each allocation up to a factor of two, then gets the new area from a
list of blocks in that size. There are relatively few lists since the
number of sizes typically encountered is small.
I personally don't need speed as much as memory efficiency (you can search
a lot of lists for the cost of a single page fault). The default malloc
is FREE, which means you can build commercial apps with it, unlike some
other LGPLed sources.
I suggest you search for and try another malloc package, or write one you
like better and contribute it as free (non LGPLed).
- Raw text -