comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: Question about arrays and no. of elements
Date: Sat, 17 May 2008 18:32:58 +0200
Date: 2008-05-17T18:32:58+02:00	[thread overview]
Message-ID: <ygebq34c2md.fsf@sparre-andersen.dk> (raw)
In-Reply-To: b60e9537-ab45-4856-99de-71127208813f@56g2000hsm.googlegroups.com

amal.alphonse@gmail.com writes:

> If I define an array with say a million elements, and I only put
> data in 10 of them, is it actually a waste of space/time with the
> array or does Ada only create elements when there is data to put in
> (so it is efficient)?

With GNAT on Linux, you will only use memory for the part of the array
you put something into (modulo the page size - which I think is 4 kb).

Greetings,

Jacob
-- 
The backhoe is the natural predator of the fiber optic cable.



  parent reply	other threads:[~2008-05-17 16:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15 15:19 Question about arrays and no. of elements amal.alphonse
2008-05-15 16:30 ` gautier_niouzes
2008-05-15 16:50 ` anon
2008-05-15 17:52 ` Adam Beneschan
2008-05-16  9:50 ` Ken Thomas
2008-05-17 14:20 ` Steve
2008-05-17 16:32 ` Jacob Sparre Andersen [this message]
2008-05-17 17:37   ` Ludovic Brenta
replies disabled

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