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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cb73ffe253a5caf1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Memory management clarification Date: 26 Jul 2005 10:21:18 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1122387678 9097 192.74.137.71 (26 Jul 2005 14:21:18 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 26 Jul 2005 14:21:18 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:3787 Date: 2005-07-26T10:21:18-04:00 List-Id: "Frank J. Lhota" writes: > Maciej Sobczak wrote: > > Hi, > > Trying to learn a bit of Ada I came across a statement that memory > > allocated from the pool will be implicitly reclaimed when the acces > > variable used to reference it goes out of scope. > > No, that is not true. What is true is that if an access type goes out of > scope, then the data allocated from the pool for that type will be > reclaimed. See ARM 13.11 (18). That's not quite true, either. Most implementations use a global heap by default, and never automatically reclaim memory. If you use a Storage_Size clause on a local access type, then what you say is true. But local access types are not very useful. > Most Ada implementations do not support garbage collection, and with > such implementations, your examples would simply create a lot of garbage. Right. - Bob