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,924aad49bcf9e4e7 X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Cumbersome Polymorphism Date: 1997/01/28 Message-ID: #1/1 X-Deja-AN: 212862685 sender: news@organon.com (news) references: <32E7ABE8.3BF3@eurocontrol.fr> <32ECF2A3.6371@watson.ibm.com> organization: Organon Motives, Inc. newsgroups: comp.lang.ada Date: 1997-01-28T00:00:00+00:00 List-Id: In article <32ECF2A3.6371@watson.ibm.com> "Norman H. Cohen" writes: > Richard Irvine wrote: > > The above package does not free the storage which is allocated > > in the Store operation. > > In this case, I could simply introduce an explicit deallocation > > in the Store operation, before allocating new storage. > > That is precisely the right approach: > >[...example...] This, of course, only works if the object is not referenced by other such instances of the access type. That issue is probably at the root of Richard's concern. > > Of course, Ada provides a mechanism for automating deallocation, > > using controlled types, so a better solution would make use of this: > > The use of controlled types is not warranted in this situation. The problem is, it is not of any particularly good use in the more general case either (the one where there are multiple refs). It's the same old story. You need GC. Or better yet, pool specific (type specific) GC variants. /Jon -- Jon Anthony Organon Motives, Inc. Belmont, MA 02178 617.484.3383 jsa@organon.com