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,ce667ecdc314f22 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-09 07:03:14 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!195.21.255.252!unlisys!news.snafu.de!peerfeed.news.psi.net!filter.news.psi.net!reader.dist.news.psi.net!client!not-for-mail Message-ID: <3AA8F1FA.EEEC73D1@netscape.net> From: Byron Kauffman Organization: L3 Communications, Link Simulation & Training X-Mailer: Mozilla 4.7 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Using COM Interfaces (was: Releasing Aliased Variables) References: <3AA692A8.F1283C27@netscape.net> <87bsrcs8a3.fsf@deneb.enyo.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 09 Mar 2001 09:08:42 -0600 NNTP-Posting-Host: 130.210.205.193 X-Trace: client 984150176 130.210.205.193 (Fri, 09 Mar 2001 10:02:56 EST) NNTP-Posting-Date: Fri, 09 Mar 2001 10:02:56 EST Xref: supernews.google.com comp.lang.ada:5571 Date: 2001-03-09T09:08:42-06:00 List-Id: Thanks for the discussion. Now I might narrow things down. The bindings I'm using are to the DirectSound COM interfaces. I'm declaring pointers in the package body that get passed into DS methods to create objects, after which they point to the created objects. My understanding now is that those pointers don't have to be aliased. Any guesses where the objects are created? On the other hand, some of the methods defined for the DS objects pass pointers to pointers. Would it be a good idea to alias them? I hate Microsoft. Robert A Duff wrote: > Florian Weimer writes: > > > Some time ago, there was a thread in which someone explained (I think > > Robert Dewar) that 'aliased' does not provide any help to the compiler > > regarding alias detection, register allocation etc. because the > > compiler has to be able to determine this kind of information anyway > > if an Address attribute is used. > > Well, you're "supposed" to use "aliased" if you're going to use > 'Address. But of course Ada 83 code doesn't do that, and Ada 95 code > only does it if the programmer knows this obscure fact. So in practice, > Robert is correct, at least for local variables, where the compiler has > a hope of tracking down all references to 'Address. > > For 'Access, you *must* use aliased. For 'Address, you *should* -- if > you don't, the RM says your code might not work. But it will *probably* > work in most cases, because compiler writers want Ada 83 code to work in > Ada 95! > > > So in code-generation terms, 'aliased' is a no-op. > > Not entirely. > > - Bob