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: dennison@telepath.com Subject: Re: Freeing Pointers to classwide types Date: 1998/09/25 Message-ID: <6ug51i$t4u$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 394710812 References: <1ftmFTC69GA.191@samson.airnet.net> <360b26a1.41575272@SantaClara01.news.InterNex.Net> <01bde866$1be8ed00$5330ea9e@UKP014459.logica.co.uk> X-Http-Proxy: 1.0 x6.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Fri Sep 25 13:15:31 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.05 [en] (WinNT; I) Date: 1998-09-25T00:00:00+00:00 List-Id: In article <01bde866$1be8ed00$5330ea9e@UKP014459.logica.co.uk>, "Bob Fletcher" wrote: > Tom Moran wrote in article > <360b26a1.41575272@SantaClara01.news.InterNex.Net>... > > Of course one > > would also hope > > procedure something(....) is > > type ptr is access .... > > p : ptr: := new ... > > ... > > end something > > to free the memory pointed to by 'p' when it leaves procedure > > something. > > Really? Isn't the object that is created by the 'new' keyword similar in > nature to a C++ 'heap' variable, in that although the pointer may go out of > scope the object will not, and needs to be explicitly destroyed? Once the access *type* goes out of scope, any ptr variable you ever could have assigned the pointer to (without using unchecked programming) is gone as well. Ada compilers are free to deallocate the memory then. How many of them actually *do* that, I'm not sure... -- T.E.D. -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum