From: Adam Beneschan <adam@irvine.com>
Subject: Re: Memory Access
Date: Mon, 7 Nov 2011 15:32:13 -0800 (PST)
Date: 2011-11-07T15:32:13-08:00 [thread overview]
Message-ID: <f5e21e2b-cf06-47f1-9bce-1811a54060d2@c16g2000pre.googlegroups.com> (raw)
In-Reply-To: m2fwhzcyrh.fsf@pushface.org
On Nov 7, 3:13 pm, Simon Wright <si...@pushface.org> wrote:
> Adam Beneschan <a...@irvine.com> writes:
> > declare
> > Dev_Table : Dev_Table_Type (1 .. Num_Devs_Cnst);
> > for Dev_Table'Address use Data_Address;
> > begin
> > -- and you can use Dev_Table in here
> > end;
>
> One thing to be wary of here is that Dev_Table might contain initialised
> components.
>
> type Integer_P is access all integer;
> type Rec is record
> I : Integer_P;
> end record;
> R : Rec;
> for R'Address use ...;
>
> may well get R.I initialised to null.
>
> I don't know whether it's a GNAT convention, but the way to avoid this
> in GNAT is to add
>
> pragma Import (Ada, R);
Yes, I forgot that; my example above should include pragma Import
(Ada, Dev_Table). I think this is in the RM. It isn't GNAT-specific.
-- Adam
next prev parent reply other threads:[~2011-11-07 23:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-07 20:09 Memory Access awdorrin
2011-11-07 21:26 ` Simon Wright
2011-11-07 22:03 ` anon
2011-11-07 22:21 ` Adam Beneschan
2011-11-07 22:42 ` Adam Beneschan
2011-11-07 23:13 ` Simon Wright
2011-11-07 23:32 ` Adam Beneschan [this message]
2011-11-08 12:22 ` awdorrin
2011-11-08 16:00 ` Adam Beneschan
2011-11-08 17:46 ` awdorrin
2011-11-08 20:11 ` Adam Beneschan
2011-11-08 20:24 ` awdorrin
2011-11-09 14:42 ` awdorrin
2011-11-08 16:10 ` awdorrin
2011-11-08 18:33 ` Simon Wright
2011-11-08 18:34 ` Simon Wright
2011-11-08 20:18 ` awdorrin
2011-11-08 12:44 ` Simon Wright
2011-11-07 22:26 ` Niklas Holsti
2011-11-07 22:53 ` Adam Beneschan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox