This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
size limit for static arrays in cygwin/gcc
- From: "Charles D. Russell" <worwor at bellsouth dot net>
- To: "cygwin cygwin" <cygwin at cygwin dot com>
- Date: Sun, 16 Feb 2003 13:12:18 -0600
- Subject: size limit for static arrays in cygwin/gcc
I have two systems, one with 64 Mb of physical memory and standard cygwin
installation that I have used happily for over a year, and a newer one with
512 Mb of physical memory. On the new one, I have used regtool to set 1024
Mb. The max_memory program listed in the users guide now verifies 1024 Mb.
My problem is getting cygwin/g77 or cygwin/f2c to fully utilize the memory
in the new computer so that I can enlarge the array sizes in my fortran
programs to accomodate my largest data sets. If anyone is willing to read a
posting with "fortran" in the subject line, they can find my real problem
described a few threads back. I described a fixup that works for me, but I
question
whether it is safe and stable.
Meanwhile, I am trying to find an equivalent problem in C so that it will
get more attention. Unfortunately, I don't know much C. The subsequent
program fails with a segmentation violation if one tries to allocate more
than a few Mb of memory on either my old or my new system. Why? What limit
am I bumping into?
/* bigc - find max static array size */
/* same size limit whether bigger array or multiple arrays */
/* if arrays are allocated dynamically, one can access much more mem */
#include <stdio.h>
int main(){
int i,j, idim;
double array[100000][2]; /* works OK */
/* double array[100000][3]; */ /* seg fault */
printf("sizeof(double)=%d\n",sizeof(double));
printf("sizeof(int)=%d\n",sizeof(int));
printf("sizeof(array)=%d\n",sizeof(array));
return 0;
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/