comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Question about arrays and no. of elements
Date: Sat, 17 May 2008 19:37:53 +0200
Date: 2008-05-17T19:37:53+02:00	[thread overview]
Message-ID: <87lk28u8zy.fsf@ludovic-brenta.org> (raw)
In-Reply-To: ygebq34c2md.fsf@sparre-andersen.dk

Jacob Sparre Andersen writes:
> amal.alphonse 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).

Actually, that's a kernel feature (commit-on-write) independent of the
compiler.

-- 
Ludovic Brenta.



      reply	other threads:[~2008-05-17 17:37 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
2008-05-17 17:37   ` Ludovic Brenta [this message]
replies disabled

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