🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50575

Re: Large Arrays

#50575
From: David Kastrup
Date: Wed, 15 Sep 1993 14:29
25 lines
1687 bytes
engp3056@leonis.nus.sg (JEROME HANSABHAYA ELLEPOLA) writes:

>I am writing a CFD code which needs 10, arrays of [101][801] in the main
>program.

>In one function there is another 5, arrays of [101][801],
>the program runs fine on a Spark10 but core dumps ( segmentation fault )
>at that point.

>When the arrays are defined as floats things seem to work.

And what are they defined as now?

>I have about 64MB of RAM, and assuming that all functions use the memory
>at all times, with 3 functions I would need (3*5+8)*101*801*4=15MB

>Hardly a problem right?
Watch out. Some OS use a few bits in the address to indicate stack
space. This *could* mean that you cannot use all your memory just
for a stack. You might try making the arrays in main() static,
and see if that changes anything.
-- 
 David Kastrup        dak@pool.informatik.rwth-aachen.de          
 Tel: +49-241-72419 Fax: +49-241-79502
 Goethestr. 20, D-52064 Aachen
Technical Details
Message-ID: <2778sa$emt@urmel.informatik.rwth-aachen.de>
Path: arc1-ca.pugleaf.net!gmd.de!urmel.informatik.rwth-aachen.de!tabaqui!dak
References: <276tfp$96n@nuscc.nus.sg>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,5b89b3128344e7ac
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-09-15 07:36:47 PST
Path: arc1-ca.pugleaf.net!gmd.de!urmel.informatik.rwth-aachen.de!tabaqui!dak
From: dak@tabaqui.informatik.rwth-aachen.de (David Kastrup)
Newsgroups: gnu.gcc.help
Subject: Re: Large Arrays
Date: 15 Sep 1993 14:29:30 GMT
Organization: Rechnerbetrieb Informatik - RWTH Aachen
Lines: 25
Distribution: gnu
Message-ID: <2778sa$emt@urmel.informatik.rwth-aachen.de>
References: <276tfp$96n@nuscc.nus.sg>
NNTP-Posting-Host: tabaqui.informatik.rwth-aachen.de
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Keywords: Double, Float