Mail Archives: djgpp/1997/01/27/12:55:58
### Please send a copy of the reply to me at a DOT appleyard AT fs2 DOT mt DOT umist DOT ac DOT uk,
as I had to unsubscribe from djgpp because of excessive email intray overload
By examining the source form of malloc(), it seems that if I call malloc(n),
and then free() it, the freed store can only be reused by a later malloc(p) if
n+4 and p+4 are in the same interval between successive powers of 2. That
means that if a program once needs to malloc() a very big block (say a
megabyte), and then to free() it, the store allegedly freed is not really free
for reallocation to later small malloc() calls, but is dead space. What
workrounds exist for this problem?
- Raw text -