www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/21/04:18:09

Date: Tue, 21 Jul 1998 11:15:17 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: nebo <nebo AT linetap DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Page fault error
In-Reply-To: <300E8D35.739@linetap.com>
Message-ID: <Pine.SUN.3.91.980721111500.6992F-100000@is>
MIME-Version: 1.0

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?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019