delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/05/14:16:04

From: "John S. Fine" <johnfine AT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: array index problem
Date: Fri, 05 Jun 1998 14:08:09 -0400
Organization: Erol's Internet Services
Lines: 23
Message-ID: <35783409.68BA@erols.com>
References: <6l98vc$k3a$5 AT trog DOT dra DOT hmg DOT gb>
Reply-To: johnfine AT erols DOT com
NNTP-Posting-Host: 207-172-241-201.s10.as8.bsd.erols.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Walter Gray wrote:

> I get a General Protection Fault if the array size is over about
> 65500  (NB, I do not mean 2^16, I mean about 65500).
> 
>  Have I hit some sort of limit on array index values?

I am sure it isn't a limit on array index values.  How is the array
allocated?  Global, static, local or malloc?

I would guess it is local and that you are seeing a stack problem.
Possibly your program is built with too small a stack limit to
handle the nearly quarter-meg array.

I have seen some things that seem to indicate there may be a limit
on the increment by which the stack can grow, even when it doesn't
overflow its full limit.  (Does anyone more knowledgable want to
comment on that one?)  A quarter Mb is an unusually large
increment to grow a stack.

-- 
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/

- Raw text -


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