comp.lang.ada
 help / color / mirror / Atom feed
From: Byron Kauffman <byronbkauffman@netscape.net>
Subject: Re: Using COM Interfaces (was: Releasing Aliased Variables)
Date: Fri, 09 Mar 2001 09:08:42 -0600
Date: 2001-03-09T09:08:42-06:00	[thread overview]
Message-ID: <3AA8F1FA.EEEC73D1@netscape.net> (raw)
In-Reply-To: wccelw8td06.fsf@world.std.com

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 <fw@deneb.enyo.de> 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




  reply	other threads:[~2001-03-09 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-07 19:57 Releasing Aliased Variables Byron Kauffman
2001-03-07 20:44 ` tmoran
2001-03-07 21:12 ` Robert A Duff
2001-03-08 13:24   ` Florian Weimer
2001-03-08 14:37     ` Pat Rogers
2001-12-27 12:26       ` Florian Weimer
2001-03-08 14:52     ` Tucker Taft
2001-03-08 16:57     ` Robert A Duff
2001-03-09 15:08       ` Byron Kauffman [this message]
2001-03-09 17:01         ` Using COM Interfaces (was: Releasing Aliased Variables) Robert A Duff
2001-03-09 21:08         ` tmoran
2001-03-12 18:45     ` Releasing Aliased Variables Richard Kenner
2001-03-07 21:31 ` Florian Weimer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox