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 X-Google-Thread: 103376,23ade4b42d9cb5f0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-21 11:01:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: "Martin Krischik" Newsgroups: comp.lang.ada Subject: Re: Eliminating copying in Gnat Date: Tue, 21 Jan 2003 19:49:16 +0100 Organization: never organized Message-ID: References: <3e2b7777$0$33930$bed64819@news.gradwell.net> <3e2c8625$0$33922$bed64819@news.gradwell.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 X-Trace: news.t-online.com 1043175638 02 19660 v3EAE6zESCAKiU 030121 19:00:38 X-Complaints-To: abuse@t-online.com X-Sender: 05341395658-0001@t-dialin.net User-Agent: Pan/0.13.0 (The whole remains beautiful) Xref: archiver1.google.com comp.lang.ada:33308 Date: 2003-01-21T19:49:16+01:00 List-Id: On Tue, 21 Jan 2003 02:27:56 +0500, Victor Porton wrote: > Path: > news.t-online.com!newsmm00.sul.t-online.com!newsfeed01.sul.t-online.de!t-on > line.de!newsfeed.stueberl.de!news-peer.gradwell.net!not-for-mail > Message-ID: <3e2c8625$0$33922$bed64819@news.gradwell.net> > From: porton@ex-code.com (Victor Porton) > Newsgroups: comp.lang.ada > Subject: Re: Eliminating copying in Gnat > Date: Tue, 21 Jan 2003 02:27:56 +0500 > References: <3e2b7777$0$33930$bed64819@news.gradwell.net> > Lines: 48 > Organization: Extreme Code Software (http://ex-code.com) > X-Newsreader: knews 1.0b.1 > X-URL: http://www.ex-code.com/ > NNTP-Posting-Date: 20 Jan 2003 23:28:37 GMT > NNTP-Posting-Host: 195.149.39.13 > X-Trace: 1043105317 news.gradwell.net 33922 mail2news/195.149.39.13 > X-Complaints-To: news-abuse@gradwell.net > Xref: linux1.krischik.com comp.lang.ada:410 > MIME-Version: 1.0 > Content-Type: text/plain; charset=us-ascii > > > In article , > Stephen Leake writes: > I don't see any relevant problems about inlining even if all > warnings are on Pass is not metioned inside the m.ads (the is no m.ads?!) so the position of the pragma inline should be ok. > (however it does not inline an unrelevant library > function). But Adjust is called 3 times :-( 3 is indeed strange. I would expect 2. One into the function and one for the return. > -- m.adb -- > with P; > procedure M is > function Pass(X: P.T) return P.T is > pragma Inline(Pass); > begin > return X; > end; > X: P.T; > Y: P.T := Pass(X); are you shure that all Adjust are part of this statement. Prehaps you like to ann anther line: Z: P:T := Pass(x); and see of the count goes up to 5 or 6. > begin > null; > end M; > > -- p.ads -- > with Ada.Finalization; > package P is > type T is new Ada.Finalization.Controlled with null record; > procedure Adjust(Object: in out T); > end P; > > -- p.adb -- > with Ada.Text_IO; > package body P is > procedure Adjust (Object: in out T) is > begin > Ada.Text_IO.Put_Line("QWER"); > end Adjust; > end P; -- Martin Krischik mailto://Martin@krischik.com http://www.martin.krischik.com