Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <000701c2d5ef$61cb2b00$1e6ad6d1@oemcomputer> From: "Charles D. Russell" To: "cygwin cygwin" Subject: size limit for static arrays in cygwin/gcc Date: Sun, 16 Feb 2003 13:12:18 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 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 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/