From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Help needed - Upper Bound of an array - Question.
Date: Wed, 8 Feb 2012 21:31:45 -0600
Date: 2012-02-08T21:31:45-06:00 [thread overview]
Message-ID: <jgven9$409$1@munin.nbi.dk> (raw)
In-Reply-To: jgrvc5$243$1@speranza.aioe.org
To correct Tom slightly, this will work when allocated in a package, but
probably not when allocated in a procedure (like the main subprogram).
For the OP's declaration, allocation on the heap shouldn't be necessary, but
library-level allocation is a must. (But I have never tried to allocate
really big objects in GNAT.)
Randy.
<tmoran@acm.org> wrote in message news:jgrvc5$243$1@speranza.aioe.org...
>> > SUBTYPE Index_30 IS Integer RANGE -500000 .. 500000;
>> > TYPE I_CoefficientsNumArray IS ARRAY(Index_30) OF Integer;
>> > I_Num : I_CoefficientsNumArray;
>>
>> Here is a 3rd source of limits on the size of the array: the index
>> subtype of
>> the array, in this case Index_30. Index_30 has 1_000_001 values, so I_Num
>> has
>> 1_000_001 components.
>
> The OP is probably using Gnat, with its very limited stack size. Other
> Ada compilers are not so limited. Janus, for instance, compiles, and
> runs on an old 3GB 32 bit Windows XP machine:
>
> type Index_30 is range -100_000_000 .. 100_000_000;
> type Coefficient_Type is new Interfaces.Unsigned_32;
> TYPE I_CoefficientsNumArray IS ARRAY(Index_30) OF Coefficient_Type;
> I_Num : I_CoefficientsNumArray;
>
> which allocates 800,000,004 bytes.
next prev parent reply other threads:[~2012-02-09 3:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-07 14:41 Help needed - Upper Bound of an array - Question adacrypt
2012-02-07 15:00 ` Yannick Duchêne (Hibou57)
2012-02-07 15:04 ` Mark Lorenzen
2012-02-07 15:08 ` Ludovic Brenta
2012-02-07 15:27 ` Yannick Duchêne (Hibou57)
2012-02-07 15:59 ` adacrypt
2012-02-07 16:13 ` Gautier write-only
2012-02-07 17:30 ` Jeffrey Carter
2012-02-07 19:51 ` tmoran
2012-02-09 3:31 ` Randy Brukardt [this message]
2012-02-07 18:22 ` Ludovic Brenta
2012-02-07 20:42 ` adacrypt
2012-02-07 18:56 ` Georg Bauhaus
2012-02-07 21:22 ` Robert A Duff
2012-02-07 15:33 ` Álex R. Mosteo
2012-02-07 22:08 ` Jerry
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox