Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* Maximum array size?
@ 1999-02-10  5:00 Owen Peter Vajk
  1999-02-21  5:00 ` Shana Tackett
  0 siblings, 1 reply; 7+ messages in thread
From: Owen Peter Vajk @ 1999-02-10  5:00 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1999-03-09  5:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <rz7n22fx6kc.fsf@corton.inria.fr>
1999-02-22  5:00 ` Maximum array size? Greg Lindahl
1999-02-10  5:00 Owen Peter Vajk
1999-02-21  5:00 ` 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

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