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 Received: by 10.68.135.231 with SMTP id pv7mr15228897pbb.8.1328652489084; Tue, 07 Feb 2012 14:08:09 -0800 (PST) Path: lh20ni271928pbb.0!nntp.google.com!news1.google.com!postnews.google.com!n12g2000yqb.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Re: Help needed - Upper Bound of an array - Question. Date: Tue, 7 Feb 2012 14:08:08 -0800 (PST) Organization: http://groups.google.com Message-ID: <68a82c06-7767-476b-b74f-bdb51796c6f2@n12g2000yqb.googlegroups.com> References: <9203a648-af0d-45a1-87ba-67373435b391@k10g2000yqk.googlegroups.com> NNTP-Posting-Host: 97.117.188.146 Mime-Version: 1.0 X-Trace: posting.google.com 1328652488 20445 127.0.0.1 (7 Feb 2012 22:08:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 7 Feb 2012 22:08:08 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n12g2000yqb.googlegroups.com; posting-host=97.117.188.146; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HLUARECNK X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-02-07T14:08:08-08:00 List-Id: On Feb 7, 7:41=A0am, 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. =A0I 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. =A0My 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? > > I need to know this before resorting to a 64-bit computer which might > not solve the problem and be an expensive mistake. > > Your help would be greatly appreciated. > > - adacrypt This question arises from time to time; see these two previous threads: http://groups.google.com/group/comp.lang.ada/browse_thread/thread/ae395e5c1= 1de7bc9/bda8d61bd3a66ee9?hl=3Den&q=3DJerry+stack&lnk=3Dnl& http://groups.google.com/group/comp.lang.ada/browse_thread/thread/419864ed9= 1cc937d?hl=3Den# (Sorry if I'm repeating anything earlier in this thread.) Your best option is to use dynamic allocation which uses the heap, then use "rename" to simplify your code. Some (lesser) problems can be solved by increasing the stack size. I don't know if this is possible from within the Ada code using pragmas, but you can do it from the shell (before running your program) using ulimit, or from within the Ada code by importing the C functions setrlimit and getrlimit. Jerry