comp.lang.ada
 help / color / mirror / Atom feed
From: Jeff C <jcreem@yahoo.com>
Subject: Re: Memory limits in Ada where Fortran has none
Date: Sat, 05 Mar 2005 20:09:24 -0500
Date: 2005-03-05T20:09:24-05:00	[thread overview]
Message-ID: <geSdncFKwIytxbffRVn-gw@comcast.com> (raw)
In-Reply-To: <1110070479.250902.220540@l41g2000cwc.googlegroups.com>

braver wrote:
> I'm interoperating with a Fortran algorithm using a very large array of
> integers:
> 
>       PARAMETER (NMAX=100000000) ! a hundred million
>       DIMENSION ND(NMAX)
> C ...
> 
> In Ada, I declared it as
> 
>    type Intarray is array (Positive range <>) of Integer;
> 
>    ND: Intarray(1..NMAX); -- (1)
> 
> -- then I get a STORAGE_ERROR right about NMAX is 2_000_000.
> 

If you are doing that in a procedure (including the main procedure) then
ND is being allocated on the Stack not the heap. If ND were inside of a 
package then you should get the same results that you got with your 
pointer approach.


As for the pointer approach also being "too small" it is not that your 
heap is limited. You can declare (via pointers or package level 
variables) lots of objects of your max size. You just can't have a 
single variable with a 'size that exceeds the 32 bit limit.

To be precise here this is not "and Ada thing". This is one particular 
vendor (guessing GCC) decision about an implementation defined 
limit...And I agree it is an unfortunate choice that was probably 
reasonable a few years ago and has now become too small.



  reply	other threads:[~2005-03-06  1:09 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-06  0:54 Memory limits in Ada where Fortran has none braver
2005-03-06  1:09 ` Jeff C [this message]
2005-03-06  6:18   ` braver
2005-03-06  9:26     ` Martin Krischik
2005-03-06 16:14       ` braver
2005-03-06 16:28         ` Jeff C
2005-03-06 23:09         ` Craig Carey
2005-03-07  0:36           ` braver
2005-03-07  5:55           ` braver
2005-03-08  5:35             ` braver
2005-03-06 14:09     ` Stephen Leake
2005-03-06  9:33 ` Martin Krischik
2005-03-06 22:13 ` Gerald
2005-03-06 23:01 ` Dr. Adrian Wrigley
2005-03-07  0:31   ` braver
2005-03-07 12:47     ` Dr. Adrian Wrigley
2005-03-07  9:41   ` Martin Krischik
2005-03-07 11:59     ` Dr. Adrian Wrigley
2005-03-07 12:26       ` Martin Krischik
2005-03-07  0:05 ` Robert A Duff
2005-03-07 18:04   ` braver
2005-03-16 19:41     ` Robert A Duff
2005-03-17 18:49       ` Martin Krischik
2005-03-08 11:24   ` Dr. Adrian Wrigley
2005-03-09  3:39     ` Craig Carey
2005-03-16 17:39       ` Craig Carey
2005-03-16 19:51     ` Robert A Duff
2005-03-16 23:47       ` Dr. Adrian Wrigley
replies disabled

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