comp.lang.ada
 help / color / mirror / Atom feed
* Memory limits in Ada where Fortran has none
@ 2005-03-06  0:54 braver
  2005-03-06  1:09 ` Jeff C
                   ` (4 more replies)
  0 siblings, 5 replies; 28+ messages in thread
From: braver @ 2005-03-06  0:54 UTC (permalink / raw)


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 I do, instead,

   type Intarray_Ptr is access Intarray;
   ND: Intarray_Ptr;
-- ...
   ND := new Intarray(1..NMAX);

-- I get the STORAGE_ERROR right about NMAX=256*1024*256, which, given
the size of Integer as 32 bits, shows the limit of the _total heap size
in bits_ as the max 32 value.  So it leaves me with a 256 MB heap size,
or about 67_108_864 elements -- ~2/3 of what I need.
How do I increase the heap size, if at all possible, or the main memory
size?

In GNU f77, the array allocates and works fine, so I thought to import
it with pragma Import, just as I do with subroutines -- but the linkage
name for a variable in MAIN__ is not showing in mn main.o!  Any idea
how to link/import a GNU f77 _variable_ from GNAT?

Overall, Ada being the language for large systems, I found it
surprising that Fortran can allocate enough arrays to fill in my
memory, or even take up virtual memory, while Ada raises
STORAGE_ERRORs!  I'd like to simply use (1), as in Fortran, and be done
with it...

Cheers,
Alexy




^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2005-03-17 18:49 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-06  0:54 Memory limits in Ada where Fortran has none braver
2005-03-06  1:09 ` Jeff C
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

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