Date: Sat, 11 Nov 2000 09:08:55 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-Id: <9003-Sat11Nov2000090855+0200-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6 In-reply-to: <8ui4h7$vac$1@nnrp1.deja.com> (dcasale@my-deja.com) Subject: Re: My program hangs under RHIDE's debugger References: <8ueodf$5ep$1 AT nnrp1 DOT deja DOT com> <9743-Thu09Nov2000224218+0200-eliz AT is DOT elta DOT co DOT il> <8ufgue$reg$1 AT nnrp1 DOT deja DOT com> <9003-Fri10Nov2000120410+0200-eliz AT is DOT elta DOT co DOT il> <8uho2n$kr9$1 AT nnrp1 DOT deja DOT com> <2427-Sat11Nov2000013157+0200-eliz AT is DOT elta DOT co DOT il> <8ui4h7$vac$1 AT nnrp1 DOT deja DOT com> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: dcasale AT my-deja DOT com > Newsgroups: comp.os.msdos.djgpp > Date: Sat, 11 Nov 2000 00:40:07 GMT > > No, I mean the allocation failed _but the program continued_. This means you don't have any more free memory left, as far as malloc is concerned. > Why did the malloc suddenly fail when there was memory still > available? 12 bytes and 40 bytes had been freed previous to these two > failed allocations. As Nate explained, YAMD intercepts the call to `free' and keeps the memory around, so it is not freed. To prevent your program from running out of memory prematurely, install CWSDPMI r5 and increase the default extended memory and swap file size up to the maximum your system can sustain. > Like I said, the requested number of bytes was the same as the previous > two allocations/deallocations. So this isn't suspicious? Not with YAMD. In any case, suspecting malloc is usually the wrong thing to do when debugging such problems. While bugs in the library are always possible, malloc gets exercised so heavily by any DJGPP programs that such bugs are exposed pretty quickly.