Date: Tue, 21 Jul 1998 11:15:17 +0300 (IDT) From: Eli Zaretskii To: nebo cc: djgpp AT delorie DOT com Subject: Re: Page fault error In-Reply-To: <300E8D35.739@linetap.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Mon, 20 Jul 1998, nebo wrote: > One function is systematically called a user-defined number > of times by another function. The called function uses calloc() > 4 or 5 times, in order to allocate 81 bytes/calloc call, and once > the caller is done, the caller then frees the memory via a global > variable pointer array. > The global variable holds 20000 entries, but the program crashes > after 15800 or so. The called function also uses sprintf() to > assign a string to the new memory. Is this under CWSDPMI? If so, it sounds a lot like the problem with insufficient internal heap, which usually happens when the application requests a lot of small chunks. Check out section 15.4 of the DJGPP FAQ list (v2/faq210b.zip) for a possible solution. > I haven't tried > using malloc instead(my next step), but would much prefer > to use calloc(). I don't think malloc will change anything in your case, but why do you prefer calloc, anyway?