comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: Using COM Interfaces (was: Releasing Aliased Variables)
Date: Fri, 09 Mar 2001 21:08:32 GMT
Date: 2001-03-09T21:08:32+00:00	[thread overview]
Message-ID: <kDbq6.11266$zV3.1000598@news1.frmt1.sfba.home.com> (raw)
In-Reply-To: 3AA8F1FA.EEEC73D1@netscape.net

>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.
>...
>Any guesses where the objects are created?
  Do you mean you are passing null pointers in and getting actual pointers
out?  So the C calling sequence must include something like
  &buffer_pointer
and you are actually passing the locations of pointers in, and letting
the DS methods put values into those pointers.  If that's the case, then
the storage allocation is occurring in the DS methods, not in the
Ada part of the program, and it would probably be wise to make an
appropriate DS call to ask it to free the space, rather than trying
to do an Unchecked_Deallocation in the Ada part.  (It may be that
the DS system wants to do some extra housekeeping when you free a
buffer, for instance.)

>My understanding now is that those pointers don't have to be aliased.
  It's not Pointers that need to be aliased, but rather things pointed
At.  Of course you can point At a pointer as well as pointing At an
integer, in which case that pointer should indeed be aliased.  If
you are passing things'access in to DS methods, then, since they are
used with 'access, they need to be aliased.  But if you are declaring
that DS parameter as "in out" or "out", then you don't need the 'access,
which means you don't need the "aliased".



  parent reply	other threads:[~2001-03-09 21: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       ` Using COM Interfaces (was: Releasing Aliased Variables) Byron Kauffman
2001-03-09 17:01         ` Robert A Duff
2001-03-09 21:08         ` tmoran [this message]
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