Date: Tue, 28 Jan 1997 11:08:49 +0200 (IST) From: Eli Zaretskii To: "A.Appleyard" cc: DJGPP AT delorie DOT com Subject: Re: A misfeature re malloc() and new In-Reply-To: <957C9527FA@fs2.mt.umist.ac.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 27 Jan 1997, A.Appleyard wrote: > 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. Can you post a short program that exhibits this behavior? I had on a few occasions thought I've found a severe bug in that algorithm, but malloc surprised me when I tried to write a program that would fail it. > What workrounds exist for this problem? If the problem is indeed a real one, nothing short of replacing the malloc algorithms would do, IMHO. If you don't care about GPL restrictions, you can download the GNU Malloc library and use it instead (the Emacs source distribution includes it, and Emacs uses those functions instead of those from libc).