Mail Archives: djgpp/2000/11/11/02:11:31
> 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.
- Raw text -