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,109419a9e4966aaf X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Heap Memory Management Question(s) Date: 05 Apr 2006 17:42:09 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <443242EC.2060603@gmx.de> <4433A136.6080503@gmx.de> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1144273329 17624 192.74.137.71 (5 Apr 2006 21:42:09 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 5 Apr 2006 21:42:09 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:3732 Date: 2006-04-05T17:42:09-04:00 List-Id: Florian Liekweg writes: > Sorry for being unclear. I was thinking of, e.g., a package variable, > which, as I understand, is not visible and/or accessible everywhere, > but it exists and keeps its state over the lifetime of the program. > > My assumption is the following: > We can momentarily leave the area where the variable is /visible/, > but it stays in existence. The lifetime of the object it points to > can now span the entire program, not just the time the variable is > visible. > My conclusion is: Visibility of the access type doesn't help when it > comes to determining the lifetime of that object. NB, it could > of course /improve/ whatever analysis a sophisticated compiler > might do. That's correct. Lifetime is different from visibility. If you declare: X: Integer; in a library package, it lasts essentially "forever". Likewise, if you declare an access type: type A is access ...; the heap-allocated objects in A's "collection" can last "forever" (or you can use Unchecked_Deallocation to destroy them). - Bob