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,edd7ea1b2d7e9a18 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-13 20:16:22 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!chcgil2-snh1.gtei.net!news.gtei.net!wn12feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Pitfall: freeing access discriminants References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc52.ops.asp.att.net 1045196181 12.234.13.56 (Fri, 14 Feb 2003 04:16:21 GMT) NNTP-Posting-Date: Fri, 14 Feb 2003 04:16:21 GMT Organization: AT&T Broadband Date: Fri, 14 Feb 2003 04:16:21 GMT Xref: archiver1.google.com comp.lang.ada:34085 Date: 2003-02-14T04:16:21+00:00 List-Id: > > > type T(D: access Integer) > > > type Integer_Ptr is access all Integer; > > should both refer to the same storage pool. > > I don't see how you can be sure that D.all is allocated from the same > pool as 'access all Integer'? (a bit odd anyway, if you say 'access > *all* ' you imply that blind deallocation is iffy). The "all" is indeed distracting here, but the original posting showed that the sole possible variable of the type was a copy of the discriminant, so Free is OK. > type Integer_Ptr is access all Integer; >... > P: Integer_Ptr := Integer_Ptr (Object.D); According to Cohen 2nd ed p 361, Integer_Ptr cannot be a pool-specific access type. And how would you make the anonymous access type "D: access Integer" allocate from other than the standard pool?