comp.lang.ada
 help / color / mirror / Atom feed
From: Vincent Smeets <Vincent.Smeets@CCI.Sema.de>
Subject: Re: Data Elaboration
Date: Fri, 22 Jun 2001 11:29:59 +0200
Date: 2001-06-22T11:29:59+02:00	[thread overview]
Message-ID: <3B331017.5F34A904@CCI.Sema.de> (raw)
In-Reply-To: 3b32efb0$1@pull.gecm.com

Martin Dowie wrote:
> 
> Ok then, here's part 2 of the question! Given that they
> will be elaborated in order (I was looking at section 3.3.1
> not 3.11 :-(. If I change that to -
> 
>   with My_Allocator;
> 
>   package Blah is
> 
>      Bool1 : Boolean;  -- always elaborates first
>     pragma Import (Ada, Bool1);
>     pragma Volatile (Bool1);
>     for Bool1'Address use My_Allocator (Bool1'Size);
> 
>     Bool2 : Boolean;  -- always elaborates second
>     pragma Import (Ada, Bool2);
>     pragma Volatile (Bool2);
>     for Bool2'Address use My_Allocator (Bool2'Size);
> 
>      Int1  : Integer;  -- always elaborates third
>     pragma Import (Ada, Int1);
>     pragma Volatile (Int1);
>     for Int'Address use My_Allocator (Int1'Size);
> 
>   end Blah;
> 
> where My_Allocator assigns memory space from a particular
> start address, my objects will always elaborate to the
> same locations, yes? (My_Allocator containing a protect
> object to ensure sequential calculation of the addresses).

I would say (I'm not 100% sure) that the order of elaboration of Bool1,
Bool2 and Int1 will be the same. This does not mean that they always
will use the same memory. In case you have an other package with the
same allocation-construct, you can't directly predickt the order of
elaboration of packages. You can do some tuning with "pargma Elaborate".

By the way. You will need a pragma Elaborate (My_Allocator); for this
package.

Vincent

-- Vincent Smeets                    Competence Center Informatik GmbH
-- Tel. : +49-5931-805461            Postfach 1225
-- Fax  : +49-5931-805175            49702 Meppen, Germany
-- mailto:Vincent.Smeets@CCI.Sema.de http://www.CCI.de/
-- PGP fingerprint: E2437E38AAA9CA7D A31E7D751F1B6454 8AED7B76



  reply	other threads:[~2001-06-22  9:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-21 16:22 Data Elaboration Martin Dowie
2001-06-21 22:12 ` Jeffrey Carter
2001-06-22  6:04   ` Vincent Smeets
2001-06-22  7:23     ` Martin Dowie
2001-06-22  9:29       ` Vincent Smeets [this message]
2001-06-22 10:21         ` Martin Dowie
replies disabled

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