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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b2dd3ff35d68d825 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-09 14:39:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Samuel Tardieu Newsgroups: comp.lang.ada Subject: Re: Unchecked_Deallocation subtleties Date: Wed, 09 Apr 2003 23:39:31 +0200 Organization: TELECOM Paris Message-ID: <87llyj5p0s.fsf@inf.enst.fr> References: <87smssj94u.fsf@inf.enst.fr> <3E94502E.6070108@cogeco.ca> NNTP-Posting-Host: m34.net81-65-250.noos.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1049924372 95453 81.65.250.34 (9 Apr 2003 21:39:32 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 9 Apr 2003 21:39:32 +0000 (UTC) Mail-Copies-To: sam@rfc1149.net User-Agent: Gnus/5.090007 (Oort Gnus v0.07) XEmacs/21.4 (Military Intelligence, i386--freebsd) Cancel-Lock: sha1:G1RSoH3VDf0vEtIGgCz+el3Dc9k= Xref: archiver1.google.com comp.lang.ada:36036 Date: 2003-04-09T23:39:31+02:00 List-Id: >>>>> "Nick" == Nick Roberts writes: Nick> Consider the following example skeleton piece of code: Nick> declare Nick> X: Some_Access_Type; Nick> begin Nick> ... -- [1] Y := X.all; -- [2] last use of X ... -- [3] Nick> Free(X); -- [4] Nick> end; Nick> Although it may be that no compiler would (or even could) do so Nick> in practice, other rules in the ARM made it theoretically Nick> possible for the implementation to automatically reclaim the Nick> storage occupied by whatever X pointed to (assuming no other Nick> access value pointed to it) at any point in the elided code Nick> section [3]. I would say that Free(X) is certainly a use of X, so the last use of X is not in [2], it is in [4]. Sam -- Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/sam