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,a46843ba8cee64d2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-19 14:49:51 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: dinamic object reclamation Date: 19 Sep 2001 17:47:51 -0400 Organization: NASA Goddard Space Flight Center Message-ID: References: <9oa69d$6ej$1@ns.omskelecom.ru> <9oantr$kc1$1@ns.omskelecom.ru> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1000936136 18230 128.183.220.71 (19 Sep 2001 21:48:56 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 19 Sep 2001 21:48:56 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:13192 Date: 2001-09-19T21:48:56+00:00 List-Id: "Anisimkov" writes: > > Types derived from Ada.Finalization.Controlled can have their memory > > automatically freed when execution leaves the scope in which it was > > declared. > > Anyway we have to call Ada.Unchecked_Deallocation > inside of overloaded Finalize procedure > for memory allocated inside of Initialize procedure. > > Where is a "Checked" deallocation ? There is no "Checked" deallocation, because the compiler cannot guarantee that you have not copied the pointer, thus it cannot guarantee that the deallocation is "safe". You can implement your own abstract data type with reference counting, or some other scheme, but the compiler won't do it for you. -- -- Stephe