From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1ff542cf207f32ca X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.135.231 with SMTP id pv7mr14350196pbb.8.1328628771413; Tue, 07 Feb 2012 07:32:51 -0800 (PST) Path: lh20ni270906pbb.0!nntp.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?B?w4FsZXggUi4=?= Mosteo Newsgroups: comp.lang.ada Subject: Re: Help needed - Upper Bound of an array - Question. Date: Tue, 07 Feb 2012 16:33:13 +0100 Organization: A noiseless patient Spider Message-ID: References: <9203a648-af0d-45a1-87ba-67373435b391@k10g2000yqk.googlegroups.com> Mime-Version: 1.0 Injection-Date: Tue, 7 Feb 2012 15:32:50 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="U8D4Up5H9mlhgn5jKwjRxA"; logging-data="29783"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qIRszgAFKDQu23XBLedSL" User-Agent: KNode/4.8.0 Cancel-Lock: sha1:GWatM4a3kNxpf42MfDyOEX59ceE= Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Date: 2012-02-07T16:33:13+01:00 List-Id: adacrypt wrote: > I am not an expert programmer in Ada but I have taught myself enough > Ada-95 to be able to write some difficult cryptography programs that I > post in another group. > > My problem is this. I need to test the frequency of the ciphertext > which is sometimes a long string of large positive integers of 7 or 8 > digits in magnitude and to do that I need an array that will > accommodate up to 10,000,000 elements ideally. > > I have already found out that I cannot go more than 500,000 elements > in the array size. My computer has 32-bit architecture. > > What I need to know from some kind person is this - Is the array size > a property of the Ada-95 language or the computer? Without looking at what the ARM has to say, my first impression is that this is a problem with stack size limits. I would expect otherwise your arrays to be potentially as large as ~2^31 elements. You could try to raise the stack size (in a task, with pragma Stack_Size, and *additionally* in your linker/OS, with whatever means it provides). Or, perhaps simpler, you could allocate the array in the heap with "new". You could further and optionally create a [limited] private type that exposed the array via an access, and that took care of memory management. Or you could try to move to Ada 2005 and use vectors from the standard library, although this most likely will have an impact on speed. > I need to know this before resorting to a 64-bit computer which might > not solve the problem and be an expensive mistake. As last resort, I'd try to cook some ADT before investing serious money ;-) > Your help would be greatly appreciated. Hope this helps, I'm sure you'll get answers from the experts soon. > - adacrypt