From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 15107 invoked from network); 2 Jul 1998 01:37:07 -0000 Received: from digger1.defence.gov.au (203.5.217.4) by mail2.redhat.com with SMTP; 2 Jul 1998 01:37:07 -0000 Received: from exchsa1.dsto.defence.gov.au (exchsa1.dsto.defence.gov.au [131.185.2.94]) by digger1.defence.gov.au (8.7.5/8.7.3) with ESMTP id LAA23330 for ; Thu, 2 Jul 1998 11:03:08 +0930 (CST) Received: from fang.dsto.defence.gov.au ([131.185.2.5]) by exchsa1.dsto.defence.gov.au with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.1960.3) id 3DAGZS0B; Thu, 2 Jul 1998 11:06:59 +0930 Received: from venus.dsto.defence.gov.au (fb-33-pc195.dsto.defence.gov.au [146.221.33.195]) by fang.dsto.defence.gov.au (8.8.5/8.8.5) with ESMTP id LAA12007 for ; Thu, 2 Jul 1998 11:07:00 +0930 (CST) Received: (from huw@localhost) by venus.dsto.defence.gov.au (8.8.7/8.8.7) id LAA02039; Thu, 2 Jul 1998 11:36:52 +1000 To: axp-list@redhat.com Subject: Re: G77 dynamic memory allocation References: <199807010949.DAA18686@walleye.gonefishing.sk.ca> From: Weiping Hu Date: 02 Jul 1998 03:36:51 +0200 In-Reply-To: Larry Zimmerman's message of "Wed, 1 Jul 1998 03:49:44 -0600" Message-ID: X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" Larry, I just tried this, and got the following result. There is a segmentation fault. I run egcs-1.0.2-8 on RH5.1, i386. Was the test for Alpha only? Regards, Weiping [huw@venus Test]$ make egcs -g -static -Wall -DUSE_FALLOC -DHAVE_64BIT_ADDR -c falloc.c g77 -fintrin-case-any -fmatch-case-any -DUSE_FALLOC -DHAVE_64BIT_ADDR -c mysubs.F g77 -fintrin-case-any -fmatch-case-any -DUSE_FALLOC -DHAVE_64BIT_ADDR lzmemtest.F falloc.o mysubs.o -static -lc -o lzmemtest [huw@venus Test]$ ./lzmemtest lzmemtest: Started lzmemtest: nreal 300 nint 300 kint 150 fmalloc: trying to allocate 2400 bytes Address of real*8 array is 4429655688 realinit: Initializing Real Array realinit: Start of array address is 134688392 fmalloc: trying to allocate 2400 bytes Address of integer array is 578379606387013616 intinit: Initializing Integer Array intinit: Start of array address is 134690800 End of 2nd array is 578379606387016016 Start of K subarray is 578379606387014816 Mysub: Checking values in arrays Segmentation fault (core dumped) Larry Zimmerman writes: > This is sort of a followup to the thread "malloc oddity ?" > > I am interested in this subject because I'm trying to port > some FORTRAN code to Linux that uses structures and dynamic > memory allocation. AFAIK, egcs/g77 does not directly support > dynamic memory allocation, but Mike Tripicco let me look at > their code for dynamic array sizing. I tried a slight modification > of Mike's code, then managed to get "real" dynamic memory > allocation working! > > This is not as clean as using compiler-supported functions, > but it seems to work for me in my test program. If you're > interested, you can get the details at: > http://walleye.gonefishing.sk.ca/laz/linux/falloc.html > > My test program, etc. are accessible through this web page. > > Thanks to Mike and others who commented on Linux-Alpha memory > allocation for helping to solve one of my key porting problems. > > Now if the g77 guys would just move structures higher up the priority > list!! > > Larry Z. > > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com