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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2925b133078d1557 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Flexible Strings (was Equality operator...) Date: 1997/05/04 Message-ID: #1/1 X-Deja-AN: 239288875 References: <9704301422.AA07755@most> <3F2AA8DEC61418AE.502E81A8ECA1C4E7.3A25DE2FB38755A4@library-proxy.airnews.net> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-05-04T00:00:00+00:00 List-Id: Kevin Cline said <> That shows a misunderstanding of language semantics. There is no easy way to formalize what it means to free storage that would encompass all possible dynamic allocation techiques, including effects of fragmentation etc. For example, if we try to define that certain classes of programs should run for ever without getting storage error, then it is still a semantically valid implementation to just use up virtual memory for ever (if necessary asking for new tapes to be loaded to store the old junk). So no language standard can meaninfuly specify formal semantiocs for what deallocation might mean, beyond specifying that reference to freed storage is in an appropriate sense incorrect. So Ada is no different from C or Pascal or any other lanuage here. I suspect that Kevin is not the kind of person who spends his time studying formal standards, but if you want to follow this up, for example go look at the definition of Dispose in the ANSI Pascal standard. What does the Ada standard say about Unchecked_Deallocation: 9 Free(X), when X is not equal to null first performs finalization, as described in 7.6. It then deallocates the storage occupied by the object designated by X. If the storage pool is a user-defined Nice, but of course deallocate is not really formally defined, then we have the implementation advice: 17 For a standard storage pool, Free should actually reclaim the storage. again "actually reclaim" is not formally defined. BUT, does this matter in practice? Of course not, all Ada compilers always have followed this advice for the standard storage pool, and it would be surprising if it were otherwise. This is exactly the same situation as observing that all C compilers actualy free storage when free is used. Is it possible to make a formally conforming implementation in which unchecked deallocation is useless. Most certainly. It is also possible to make a formally conforming impl,ementation in which all integr additions take one hour to complete. Bothy implementations are formally correct according to the standard, both are totally useless!