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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b99897135d6631cc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 26 Jun 2004 10:54:45 -0500 Date: Sat, 26 Jun 2004 11:54:45 -0400 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: memory management and productivity References: <40d15023$1_1@baen1673807.greenlnk.net> <2jnh22F12nvieU2@uni-berlin.de> <1087840264.973597@master.nyc.kbcfp.com> In-Reply-To: <1087840264.973597@master.nyc.kbcfp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.90.114 X-Trace: sv3-Ile7L7fqTJn8ioV4ebgzICAn1uqgNHsG8VISe54W6KEZEoi0zhXvtUh0tI6IQJjSRQBNthRPZlI0zCk!TJIznNoyzRzpw6wvo+55GZIM/huRnsZLIm2MZCQBG8b4V7WMx9yCXqm4bPWtxg== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: g2news1.google.com comp.lang.ada:1926 Date: 2004-06-26T11:54:45-04:00 List-Id: Hyman Rosen wrote: > I believe, but I'm not sure, that in Ada if a pointer *type* (not > a pointer object) goes out of scope, then all objects of that type > are deallocated. Hmmm, a better description is that if a type goes out of scope, all objects of that type are deallocated. If a storage pool goes out of scope, all objects in the pool are deallocated. If an access type goes out of scope though, nothing special happens. It is easiest to see this by thinking about: declare type Foo is private; Foob: Foo; procedure Fubar(F: in Foo) is type Bar is access all Foo B: Bar := F'access; begin null end; begin Fubar(Foob); end; Obviously you don't want Foob to be deallocated when Bar goes out of scope. B will be deallocated when Fubar returns, but that is because B goes out of scope, not Bar. -- Robert I. Eachus "Reason and experience both forbid us to expect that national morality can prevail in exclusion of religious principles." -- George Washington