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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ce667ecdc314f22 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-09 13:08:32 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!cyclone-sf.pbi.net!209.81.14.120!feeder.via.net!newshub2.rdc1.sfba.home.com!news.home.com!news1.frmt1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Using COM Interfaces (was: Releasing Aliased Variables) References: <3AA8F1FA.EEEC73D1@netscape.net> X-Newsreader: Tom's custom newsreader Message-ID: Date: Fri, 09 Mar 2001 21:08:32 GMT NNTP-Posting-Host: 24.20.190.201 X-Complaints-To: abuse@home.net X-Trace: news1.frmt1.sfba.home.com 984172112 24.20.190.201 (Fri, 09 Mar 2001 13:08:32 PST) NNTP-Posting-Date: Fri, 09 Mar 2001 13:08:32 PST Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: supernews.google.com comp.lang.ada:5584 Date: 2001-03-09T21:08:32+00:00 List-Id: >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".