comp.lang.ada
 help / color / mirror / Atom feed
* Very Large Arrays (VLAs)
@ 2001-01-29 15:48 Marc A. Criley
  2001-01-30  6:29 ` Robert Dewar
  0 siblings, 1 reply; 4+ messages in thread
From: Marc A. Criley @ 2001-01-29 15:48 UTC (permalink / raw)


While it's certainly possible to declare very large constrained arrays,
where "very large" means an Index_Type'Range equaling or exceeding
Positive'Range, has anyone ever actually declared and used such an array
in production code?

(I'm not talking using such a type as in index for an _unconstrained_
array that is subsequently constrained to a smaller range, such as the
way the String type is managed.)

Array objects of such a type would obviously require a great deal of
storage, and when I've accidentally allocated such arrays in the past, a
Storage_Error was usually raised.

I'm not asking how one would go about managing such a VLA--just if any
production system has actually used such an array.

Thanks,

Marc A. Criley
Senior Staff Engineer
Quadrus Corporation
www.quadruscorp.com



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Very Large Arrays (VLAs)
  2001-01-29 15:48 Very Large Arrays (VLAs) Marc A. Criley
@ 2001-01-30  6:29 ` Robert Dewar
  2001-01-30 12:20   ` Dale Stanbrough
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Dewar @ 2001-01-30  6:29 UTC (permalink / raw)


In article <3A7582BD.D51615EB@earthlink.net>,
  "Marc A. Criley" <mcquadex@earthlink.net> wrote:
> While it's certainly possible to declare very large
constrained arrays,
> where "very large" means an Index_Type'Range equaling or
exceeding
> Positive'Range, has anyone ever actually declared and used
such an array
> in production code?

Well by used you mean allocated here (certainly such types
are commonly used, see for example the GNAT.Table abstraction
in GNAT).

To allocate them is just a matter of available virtual
memory. Clearly if you declare

  type x is array (Natural) of Natural;
  v : x;

you are NOT going to succeed if you have only 32-bits of
address space :-)


Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Very Large Arrays (VLAs)
  2001-01-30  6:29 ` Robert Dewar
@ 2001-01-30 12:20   ` Dale Stanbrough
  2001-01-30 12:35     ` Florian Weimer
  0 siblings, 1 reply; 4+ messages in thread
From: Dale Stanbrough @ 2001-01-30 12:20 UTC (permalink / raw)


Robert Dewar wrote:

> To allocate them is just a matter of available virtual
> memory. Clearly if you declare
> 
>   type x is array (Natural) of Natural;
>   v : x;
> 
> you are NOT going to succeed if you have only 32-bits of
> address space :-)

To which Dale replies the following trivia...

Unless of course Natural (being a subtype of Integer) is only 16 
bits long (which is all we can rely on ;-), and we have a 32 bit
environment. I'm not sure there are that many architectures like
that, but the older segmented intel architectures may have been 
in this category.


Dale



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Very Large Arrays (VLAs)
  2001-01-30 12:20   ` Dale Stanbrough
@ 2001-01-30 12:35     ` Florian Weimer
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Weimer @ 2001-01-30 12:35 UTC (permalink / raw)


Dale Stanbrough <dale@cs.rmit.edu.au> writes:

> Robert Dewar wrote:
> 
> > To allocate them is just a matter of available virtual
> > memory. Clearly if you declare
> > 
> >   type x is array (Natural) of Natural;
> >   v : x;
> > 
> > you are NOT going to succeed if you have only 32-bits of
> > address space :-)

> Unless of course Natural (being a subtype of Integer) is only 16 
> bits long (which is all we can rely on ;-), and we have a 32 bit
> environment. I'm not sure there are that many architectures like
> that, but the older segmented intel architectures may have been 
> in this category.

IIRC, the 80286 architecture only has 24 address bits.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-01-30 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-29 15:48 Very Large Arrays (VLAs) Marc A. Criley
2001-01-30  6:29 ` Robert Dewar
2001-01-30 12:20   ` Dale Stanbrough
2001-01-30 12:35     ` Florian Weimer

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