From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: Pass by reference
Date: Tue, 13 Apr 2004 14:42:46 +0200
Date: 2004-04-13T14:42:46+02:00 [thread overview]
Message-ID: <1142490.NlFoPlvMXb@linux1.krischik.com> (raw)
In-Reply-To: 19b0e504.0404090453.3c276b@posting.google.com
Dan McLeran wrote:
>> Good Ada compiler will do what is best. So "array (1 .. 2) of Character"
>> is likely to be passed by value while "array (1 .. 10_000) of Integer" is
>> probably passed by reference. And some Ada compilers might even use pass
>> by register.
>
> Not sure what you mean by 'pass by register'. Maybe each value of a
> 2-element array are loaded into registers and then read by the calling
> function?
Well on a 32bit CPU any data with 'Size <= 32 can be passed by register. But
this is purly academic since AFAIK the standart x86 compiler won't do pass
by register anyway.
>> You say what you need (in, out, in out) and the compiler will choose the
>> optimal way to fullfill you which.
>
> This is what I want to solidify in my brain. Alot of people posting
> replies seem to say that the compiler has more freedom than the RM
> specifies. If most Ada compilers are conforming, I would assume that
> the compiler only has freedom for unspecified types. By-reference and
> by-values types must be passed as stated in RM 6.2.
True, however there is a reason why By-reference are By-reference. They
yould not be anything else - otherwise dispaching would not work.
With Regards
Martin
--
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com
next prev parent reply other threads:[~2004-04-13 12:42 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-08 14:52 Pass by reference Dan McLeran
2004-04-08 18:21 ` Martin Krischik
2004-04-09 12:53 ` Dan McLeran
2004-04-13 12:42 ` Martin Krischik [this message]
2004-04-08 19:04 ` Jim Rogers
2004-04-09 3:24 ` Dan McLeran
2004-04-09 0:01 ` Stephen Leake
2004-04-09 12:38 ` Dan McLeran
2004-04-09 13:03 ` Dmitry A. Kazakov
2004-04-09 19:09 ` Dan McLeran
2004-04-10 10:49 ` Dmitry A. Kazakov
2004-04-11 12:43 ` Florian Weimer
2004-04-12 10:29 ` Dmitry A. Kazakov
2004-04-12 12:29 ` Samuel Tardieu
2004-04-13 8:46 ` Dmitry A. Kazakov
2004-04-10 1:42 ` Stephen Leake
2004-04-10 16:05 ` chris
2004-04-09 12:44 ` Dan McLeran
2004-04-09 22:44 ` Randy Brukardt
2004-04-09 14:44 ` Simon Wright
2004-04-09 1:15 ` Jeffrey Carter
2004-04-09 1:28 ` Pat Rogers
2004-04-10 1:05 ` Jeffrey Carter
2004-04-09 12:57 ` Dan McLeran
2004-04-10 1:16 ` Jeffrey Carter
2004-04-09 4:03 ` Steve
2004-04-09 14:50 ` Simon Wright
2004-04-09 17:12 ` Pat Rogers
2004-04-09 19:33 ` Vinzent 'Gadget' Hoefler
2004-04-10 6:33 ` Simon Wright
2004-04-13 10:26 ` Vinzent 'Gadget' Hoefler
2004-04-14 17:27 ` Simon Wright
2004-04-15 9:43 ` Vinzent 'Gadget' Hoefler
2004-04-17 7:59 ` Simon Wright
2004-04-11 12:45 ` Florian Weimer
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox