comp.lang.ada
 help / color / mirror / Atom feed
From: "Álex R. Mosteo" <alejandro@mosteo.com>
Subject: Re: Help needed - Upper Bound of an array - Question.
Date: Tue, 07 Feb 2012 16:33:13 +0100
Date: 2012-02-07T16:33:13+01:00	[thread overview]
Message-ID: <jgrg72$t2n$1@dont-email.me> (raw)
In-Reply-To: 9203a648-af0d-45a1-87ba-67373435b391@k10g2000yqk.googlegroups.com

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




  parent reply	other threads:[~2012-02-07 15:32 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
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 [this message]
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