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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ed6a891101ff4e06 X-Google-Attributes: gid103376,public From: tmoran@bix.com (Tom Moran) Subject: Re: Freeing Pointers to classwide types Date: 1998/09/27 Message-ID: <360e790d.241368@SantaClara01.news.InterNex.Net>#1/1 X-Deja-AN: 395368942 References: <1ftmFTC69GA.191@samson.airnet.net> <360b26a1.41575272@SantaClara01.news.InterNex.Net> <6ugeu2$79u$1@nnrp1.dejanews.com> <360c4a70.29707515@SantaClara01.news.InterNex.Net> <6uifpt$e98$1@nnrp1.dejanews.com> <360d1380.165146@SantaClara01.news.InterNex.Net> <6ulj29$ne3$1@nnrp1.dejanews.com> Organization: InterNex Information Services 1-800-595-3333 Newsgroups: comp.lang.ada Date: 1998-09-27T00:00:00+00:00 List-Id: >This can be done with access discriminants, but the most normal way of doing >things is to make the pointer finalizable. Neither of which works in the case under discussion, where the access type was declared inside a procedure and thus after the (global) type definition. I quite agree that Ada is a powerful language in which you can find a way to do almost anything - but sometimes it takes a substantial change in the design ( "make the pointer finalizable") to accomplish the goal. It's usually also true that a new design is in fact much better than the one that painted you into a corner. But in this case it seems to me you are saying "do a big redesign, possibly affecting any package that uses this type, in which a bunch of stuff is made global and complex, instead of local and straightforward, or take the risk of a major storage leak, or use unchecked programming". It might even make a person include "no storage leak in this case" as a criterion in choosing one compiler over another. You say it's expensive to not have a storage leak in this case. Why? Do there exist compilers that do leak? You've said Gnat doesn't leak - are there plans to change that?