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,6b1a1ed8b075945 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!w3g2000hsg.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Allocators and exceptions Date: Tue, 11 Sep 2007 08:33:08 -0700 Organization: http://groups.google.com Message-ID: <1189524788.300591.312380@w3g2000hsg.googlegroups.com> References: <1189323618.588340.87180@o80g2000hse.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1189524788 14994 127.0.0.1 (11 Sep 2007 15:33:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 11 Sep 2007 15:33:08 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: w3g2000hsg.googlegroups.com; posting-host=66.126.103.122; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:1888 Date: 2007-09-11T08:33:08-07:00 List-Id: On Sep 10, 7:36 pm, "Randy Brukardt" wrote: > (2) I believe that the current wording of the standard *requires* that > reclamation *not* be performed in examples like this, at least if there are > any controlled components in the type. That's because there is no permission > in Ada to do finalization early - it has to be done only if the object is > explicitly destroyed or when the master goes out of scope -- which for an > allocated object is when the *type* goes out of scope. It sure seemed to me that one could create an example in which, due to a default initialization on a component that contains a function call that does some interesting stuff, the automatic reclamation Maciej is asking for would lead to a dangling reference or something just as bad. I wasn't able to create an example, but I didn't spend much time on it. Maybe something involving a self-pointer in a limited record (just to tie it into another thread!). I didn't try anything involving controlled components. But I'm still guessing that someone could come up with an example that shows that this idea won't work. -- Adam