comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeff C r e e.m" <jcreem@yahoo.com>
Subject: Re: large arrays
Date: Tue, 09 Nov 2004 23:55:00 GMT
Date: 2004-11-09T23:55:00+00:00	[thread overview]
Message-ID: <kNckd.488755$mD.84928@attbi_s02> (raw)
In-Reply-To: mailman.87.1100029172.10401.comp.lang.ada@ada-france.org


"Joel Lepinoux" <Joel.Lepinoux@ltpcm.inpg.fr> wrote in message 
news:mailman.87.1100029172.10401.comp.lang.ada@ada-france.org...
> Hello,
> for the first time I need to declare a large array (>1Go), here are my
> structures:
>
>
>  type Site         is array (1..3) of Short_Short_Integer; -- size=24 bits
>  type Site_Matrix  is array (Integer range <>, Integer range <>) of Site;
>
> -- maximum allowed size, about 245Mo
>  My_Array: Site_Matrix(1..1_132_000,1..72);
>
>
> If I increase the first upper bound (1_132_000) I get a warning from gnat
> (3.15p) comfirmed at runtime: STORAGE_ERROR: object too large
>
> This means that "My_Array" is too large but of course I can declare a
> second array of same dimensions and so one, i.e. it is not a problem of
> total space (2Go available) neither of bound out of range, etc.
>
> I would be glad to understand the origin of this limit and it would be
> great if somebody could tell me how to extend it.
> Thanks in advance
> Joel
>
>

You dont say but I assume you are using GNAT?

From the GNAT RM (6.2)

 The largest Size value permitted in GNAT is 2**31-1. Since this is a Size 
in bits, this corresponds to an object of size 256 megabytes (minus one). 
This limitation is true on all targets. The reason for this limitation is 
that it improves the quality of the code in many cases if it is known that a 
Size value can be accommodated in an object of type Integer.





  reply	other threads:[~2004-11-09 23:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-09 19:49 large arrays Joel Lepinoux
2004-11-09 23:55 ` Jeff C r e e.m [this message]
2004-11-10  3:45   ` Dr. Adrian Wrigley
2004-11-10  3:57     ` Brian May
2004-11-10 12:47     ` Jeff C r e e.m
2004-11-10  5:03   ` Steve
2004-11-10 12:41     ` Jeff C r e e.m
2004-11-11  0:07   ` Randy Brukardt
replies disabled

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