Date: Thu, 6 Mar 1997 16:59:33 +0200 (IST) From: Eli Zaretskii To: Morten Heiberg Rasmussen cc: djgpp AT delorie DOT com Subject: Re: Bug in malloc/free ? In-Reply-To: <5fm6r7$6av$1@gjallar.daimi.aau.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 6 Mar 1997, Morten Heiberg Rasmussen wrote: > In the program there is a function avail_mem() that tries to estimate the > size of the free heap by allocating as much as possible (down to blocks > of 32 bytes) and then freeing it all again. In main() I then call this > function and print the result. Afterwards I try to do two allocations. One > of 12345 bytes and then one of 30000 bytes. The allocation of 12345 bytes > fails while the one of 30000 bytes succeeds. A while ago (like 4 weeks?) Anthony Appleyard posted a small patch to malloc/free that might make this problem go away. You can find that patch by searching the DJGPP mail archives, at this URL: http://www.delorie.com/djgpp/mail-archives/ (I would suggest searching for malloc and appleyard). If you do find that patch to be the solution, please say so here. Thanks.