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: kaz@vision.crest.nt.com (Kaz Kylheku) Subject: Re: Flexible Strings (was Equality operator...) Date: 1997/05/06 Message-ID: <5kocg6$hln@bcrkh13.bnr.ca>#1/1 X-Deja-AN: 239832895 References: <9704301422.AA07755@most> Organization: Prism Systems Inc. Newsgroups: comp.lang.ada Date: 1997-05-06T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: >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. Actually Ada must be different here. If were were discussing C, we wouldn't need to generate a week long thread regarding what malloc() and free() are, and how to use them. >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. But the C standard firmly says that ``The free function causes the space pointed to by ptr to be deallocated, that is, made available for further allocation'' (ISO 9899:1990 7.10.3.2 The free function). This pretty much constitutes a requirement that the C implementation actually deallocate when free is called, which carries more weight than a mere observation about what all existing implementations do.