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,b307bd75c8071241,start X-Google-Attributes: gid103376,public From: kaz@vision.crest.nt.com (Kaz Kylheku) Subject: newbie Q: storage management Date: 1997/04/29 Message-ID: <5k5hif$7r5@bcrkh13.bnr.ca>#1/1 X-Deja-AN: 238323817 Organization: Prism Systems Inc. Newsgroups: comp.lang.ada Date: 1997-04-29T00:00:00+00:00 List-Id: I've looked at the ISO standard and the relevant FAQ's and tutorials, but I still need some discussion or clarification about the management of objects obtained via ``new'', because what I have read so far seemed rather vague in one respect. Whose responsibility is it to destroy these objects? The Ada 95 standard says that an implementation is permitted to implement garbage collection, but not required to do so. I know that it is possible to instantiate a generic freeing function for explicitly destroying objects. But why is there is this lack of symmetry in the language? On the one hand, you have a slick ``new''-expression to create objects, but the complementary deletion operation is totally obscured. Does this mean that explicit freeing of objects via an instance of Unchecked_Deallocation is discouraged (due to the potential creation of dangling references)? Is it the reponsibility of the language implementation to automagically detect when an object is no longer reachable and do the appropriate deallocation, even if garbage is not collected?