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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,56131a5c3acc678e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-03 10:43:56 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!jussieu.fr!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: Question about OO programming in Ada Date: Wed, 3 Dec 2003 12:20:36 -0600 Organization: Cuivre, Argent, Or Message-ID: References: <8urxb.19482$sb4.18182@newsread2.news.pas.earthlink.net><1792884.HtYz4Yv8lY@linux1.krischik.com> <1070466281.168920@master.nyc.kbcfp.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: melchior.cuivre.fr.eu.org 1070476885 54801 80.67.180.195 (3 Dec 2003 18:41:25 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 3 Dec 2003 18:41:25 +0000 (UTC) To: "Hyman Rosen" , "comp.lang.ada@ada.eu.org" Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.3 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:3105 Date: 2003-12-03T12:20:36-06:00 ----- Original Message ----- From: "Hyman Rosen" Newsgroups: comp.lang.ada To: Sent: Wednesday, December 03, 2003 9:44 AM Subject: Re: Question about OO programming in Ada > Dmitry A. Kazakov wrote: > > Of course one could call Unchecked_Deallocation from Finalize > > I understand that Ada permits Finalize to be called multiple times > for an object, so calling Unchecked_Deallocation from Finalize sounds > like a recipe for disaster. > How is it a "disaster" when RM95 13.11.2 (6-9) says: 6. Procedure Free has the following effect: 7 � After executing Free(X), the value of X is null. 8 � Free(X), when X is already equal to null, has no effect. 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 object, then the storage is deallocated by calling Deallocate, passing access_to_variable_subtype_name'Storage_Pool as the Pool parameter. Storage_Address is the value returned in the Storage_Address parameter of the corresponding Allocate call. Size_In_Storage_Elements and Alignment are the same values passed to the corresponding Allocate call. There is one exception: if the object being freed contains tasks, the object might not be deallocated.