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: dewarr@my-dejanews.com Subject: Re: Freeing Pointers to classwide types Date: 1998/09/28 Message-ID: <6uo83j$dv2$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 395614573 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> <360e790d.241368@SantaClara01.news.InterNex.Net> <6umkl8$qbm$1@nnrp1.dejanews.com> <360f143c.39974468@SantaClara01.news.InterNex.Net> X-Http-Proxy: 1.0 x1.dejanews.com:80 (Squid/1.1.22) for client 209.73.133.253 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Mon Sep 28 14:56:52 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/2.02 (OS/2; I) Date: 1998-09-28T00:00:00+00:00 List-Id: In article <360f143c.39974468@SantaClara01.news.InterNex.Net>, tmoran@bix.com (Tom Moran) wrote: > > it is actually quite easy > >in Ada 95 to do exactly what you want. You probably aren't familiar with > >the Storage_Pool facility -- many Ada programmers don't know this very > >powerful feature in the language well enough, but read up on it, you will > >find it allows you to do exactly what you want in a completely portable > >manner. > Deciding to use Storage Pools does not fall within my definition of > modest changes to a program. > In any case, is it required that a compiler that does not free > memory when an access type goes out of scope, must free the memory if > the access type is to a user controlled storage pool? That's not > obvious to me from reading the RM. Or would the procedure declaring > the access type also have to declare an instance of the user defined > storage pool? And if the reason not to use a compiler that frees the > storage is that it's expensive, is the user defined storage pool > technique cheap? You really should look at the Storage_Pools facility. You seem to be declaring that you are sure it is not a modest change, but then ask questions that suggest you are not quite sure what such a change would involve. In the case of GNAT, it is just a matter of adding a single representation clause for the type, not a big burden. The point about using Storage_Pool's is not that it eliminates the overhead, of course it does not, since there is no magic way of doing this, but that you only pay this overhead if you want. I find nothing in what you are saying that would seem to justify adding this additional overhead unconditionally. Indeed, the less magic going on the better as far as I am concerned. Once again, the expectation here that a compiler will free all storage associated with local allocators on scope exit is not justified. It is no more or less justified than expecting that you will find a complete garbage collector (after all this is just a special case of automatic garbage collection, why single it out?) -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum