Mail Archives: djgpp/1998/07/21/04:18:09
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 -