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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a6449b2443dcdda1 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!m73g2000hsh.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Access keyword Date: Tue, 29 Apr 2008 07:43:18 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5c732ecd-cefb-45b2-b33a-5561b522b4a3@m73g2000hsh.googlegroups.com> References: NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1209480198 25296 127.0.0.1 (29 Apr 2008 14:43:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 29 Apr 2008 14:43:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m73g2000hsh.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3) Gecko/20040924,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:21115 Date: 2008-04-29T07:43:18-07:00 List-Id: S=E9bastien wrote: > I'd like to know if there is performance issue using the access keyword? [snipped] > Is NormeAccess faster because I'm using access keyword? Have you measured a speed difference, or compared the assembly code emitted by the compiler? > I read that Ada > compiler choose if a reference or a value mode is used in the Norme > function, so it would mean that the access keyword should be used only > for runtime allocated variable. This is correct so, in your example, NormeAccess is unnecessary. However there are legitimate uses of acces types beyond dymanic memory allocation. For example a stack-allocated record may contain an access to another stack-allocated record or array. Another use for access types is access discriminants, but this is an advanced topic. -- Ludovic Brenta.