This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Array Size Limits
- From: Jack Liddle <j dot liddle1 at physics dot ox dot ac dot uk>
- To: John Podesta <podesta at CIMS dot nyu dot edu>
- Cc: gcc-help at gcc dot gnu dot org, podesta at quack dot cims dot nyu dot edu
- Date: Mon, 13 Dec 2004 12:08:30 +0000 (GMT)
- Subject: Re: Array Size Limits
- References: <200412131154.iBDBsc3C002426@quack.cims.nyu.edu>
Not to sure what you mean by GCC won't run? Does the program compile and
then seg fault when you run it?
I ran into a similar problem a few months ago (google for my name and
you'll see the posts).
Yes there is a limit to the size of your arrays can be when put on the
stack.
try instead
double *A;
A = malloc(500000*sizeof(double));
this should declare the array in the main bulk of your memory. Then
access
A as per usual.
Jack Liddle
Rudolph Peierls Centre for Theoretical Physics
University Of Oxford
On Mon, 13 Dec 2004, John Podesta wrote:
> I installed MinGw on a pentiuim 4m laptop with 1G of RAM.
> Apparently GCC won't run when I make my array size too big.
> Is there some limit on the array size and is there any way for me
> to set it up so I can have large arrays, e.g., A[500000].
> Thanks.
>
> John Podesta
> NASA GSFC
>
>