From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!o21g2000vbl.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: Performance of access type : a tiny mistake in the WikiBook ? Date: Thu, 8 Oct 2009 02:55:20 -0700 (PDT) Organization: http://groups.google.com Message-ID: <87659df3-42a8-456b-9788-f37c4c1cbdb1@o21g2000vbl.googlegroups.com> References: <91ad7397-27a8-4b9d-811e-6e62d485645c@v2g2000vbb.googlegroups.com> <31da5154-9739-4ead-8437-aaa5d70dc7e8@h30g2000vbr.googlegroups.com> NNTP-Posting-Host: 83.79.65.212 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1254995720 24580 127.0.0.1 (8 Oct 2009 09:55:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 8 Oct 2009 09:55:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o21g2000vbl.googlegroups.com; posting-host=83.79.65.212; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.25 Safari/532.0,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8623 Date: 2009-10-08T02:55:20-07:00 List-Id: > I understand what you mean about testing, but I am mainly looking for > average answers. Just things to know and to have in mind. Even if > there is no required implementation, it is well known that a lot of > compilers share some common implementation designs. I'm seeking for > informations about it, just like the way I'm sometime reading about > general tips or thoughts (I used to do the same with some prior > languages like Pascal and Eiffel, it's a bit part of learning the > thing). So here is my rule: use only "in" (whenever possible), "in out" and "out" and you will be happy. These modes are meaningful for you and the compiler knows how to handle it efficiently. Especially the compiler will consider passing by copy, even through a register (and not on the stack), an "in" parameter: procedure P_in(i: in Integer; s: in String) is begin Put_Line(Integer'Image(i)); Put_Line(s); end; The call P_in(5678,s) is compiled by GNAT GPL 2008 with (-gnatp -O2) as: movl %edi, %edx movl %esi, %ecx movl $5678, %eax call _test_in_out__p_in.1893 _________________________________________________________ Gautier's Ada programming -- http://sf.net/users/gdemont/ NB: For a direct answer, e-mail address on the Web site!