comp.lang.ada
 help / color / mirror / Atom feed
From: gdemont@my-deja.com
Subject: Re: Large arrays in GNAT
Date: 2000/07/16
Date: 2000-07-16T00:00:00+00:00	[thread overview]
Message-ID: <8kt0mb$a6b$1@nnrp1.deja.com> (raw)
In-Reply-To: 3971DC1F.D415BFBE@npolar.no


> I cannot declare an array of Float larger than 2.5 mill elements
> using my Ada95 gnat compiler (gnat-3.12p-12) on my linux box.

> A : array (Integer range 1 .. 2_500_000) of Float;

A is taken on the stack, so if the "exe" has a limit on that,
you have to extend this limit. A more comfortable way is to
allocate A in the heap - according to the OS, the only limit
is +/- the total user workspace in virtual memory (4 GB on
a 32-bit system).

type vector is array (Integer range <>) of Float;
type vector_a is access vector;

A: vector_a:= New vector(1 .. 2_500_000);

HTH
______________________________________________________
Gautier  --  http://members.xoom.com/gdemont/gsoft.htm


Sent via Deja.com http://www.deja.com/
Before you buy.




      parent reply	other threads:[~2000-07-16  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-16  0:00 Large arrays in GNAT Reinert Korsnes
2000-07-16  0:00 ` Jeff Creem
2000-07-16  0:00   ` Reinert Korsnes
2000-07-16  0:00 ` gdemont [this message]
replies disabled

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