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: a07f3367d7,8147e9052e4bc0df X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!t34g2000prd.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Child vs nested package : efficiency matter Date: Tue, 1 Jun 2010 12:44:46 -0700 (PDT) Organization: http://groups.google.com Message-ID: <46fd21ad-347d-48c2-945b-72e3d1fcef79@t34g2000prd.googlegroups.com> References: <4281c262-d761-4373-930a-39c973f1fb48@q36g2000prg.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1275421487 24490 127.0.0.1 (1 Jun 2010 19:44:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 1 Jun 2010 19:44:47 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t34g2000prd.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:12181 Date: 2010-06-01T12:44:46-07:00 List-Id: On Jun 1, 12:09=A0pm, Yannick Duch=EAne (Hibou57) wrote: > Le Tue, 01 Jun 2010 20:35:02 +0200, Adam Beneschan a = =A0 > =E9crit:> Something else that occurred to me: In the process of turning t= he > > nested packages into child packages, were there any global variables > > declared in the body of the parent package that you had to move to the > > spec (probably the private part) so that they would be visible to the > > child packages? > > No Adam, there was not. There were global variables, but just globals in = =A0 > child packages, not in parent package. > > I've just found : pragma Inline is not automatically applied, it requires= =A0 > the -gnatn option Brian talked about. I though this was automatically don= e =A0 > when the -O option is present (I rarely use inline, so I was not aware of= =A0 > that). > > Anyway, I'm interested in your experience: what did occurred to you with = =A0 > global variables ? It was just a theory. My thinking was that if you have a global variable in a package *body* (and no subunits), a compiler can, in theory, draw some conclusions about how the variable is used, since there can be no uses of the variable except by subprograms in the package body, and perhaps perform some optimizations based on that. This doesn't work if the variable is in the spec (even in the private part), since the compiler won't know what child packages might be added later that have access to the variable. Anyway, this was just a theory, not really based on any experience. -- Adam