Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Owen Peter Vajk <ovajk@leland.Stanford.EDU>
Subject: Maximum array size?
Date: 1999/02/10	[thread overview]
Message-ID: <36C208BE.1D15@leland.Stanford.EDU> (raw)

Is there a maximum size for an array in C on an alpha?  I have a program
that uses a character array that's about 27 MB, on an alpha with 128 MB
of RAM.  I compile it under gcc, and when I run it I get a segmentation
fault immediately, even before it hits my first debug print statement. 
Any suggestions?  The limit seems to be a bit below 2^23 characters. 
This bit of code produces a segmentation fault:

----------------------------
#include <stdio.h>

int main()
{
char array[8384432];
printf("Hello, world!\n");
}
----------------------------

while this one runs normally:

----------------------------
#include <stdio.h>

int main()
{
char array[8384433];
printf("Hello, world!\n");
}
----------------------------

Does this hold true for anyone else?  And does anyone know how to get
around this limit, since there is certainly more than enough physical
memory to hold such an array.  Thanks,

Owen Vajk
ovajk*@leland.stanford.edu



             reply	other threads:[~1999-02-10  5:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-10  5:00 Owen Peter Vajk [this message]
1999-02-21  5:00 ` Maximum array size? Shana Tackett
1999-02-21  5:00   ` Joachim Wesner
1999-02-21  5:00     ` Nobody
     [not found]     ` <7bqfk7$q53@bgtnsc03.worldnet.att.net>
1999-03-06  5:00       ` Ron Flory
1999-03-09  5:00   ` Shana Tackett
     [not found] <rz7n22fx6kc.fsf@corton.inria.fr>
1999-02-22  5:00 ` Greg Lindahl
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox