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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,17894b356437d04f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-19 16:44:21 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!rutgers!uwvax!fullfeed!pendragon!ames!hookup!swrinde!gatech!udel!news.mathworks.com!panix!cmcl2!thecourier.cims.nyu.edu!thecourier.cims.nyu.edu!nobody From: comar@cs.nyu.edu (Cyrille Comar) Newsgroups: comp.lang.ada Subject: Re: Question regarding LRM 5.95 7.6(19) Date: 19 Jan 1995 19:44:21 -0500 Organization: Courant Institute of Mathematical Sciences Distribution: world Message-ID: <3fn115$66n@lang8.cs.nyu.edu> References: <3fjodr$99j@gamma.ois.com> NNTP-Posting-Host: lang8.cs.nyu.edu Date: 1995-01-19T19:44:21-05:00 List-Id: beckwb@ois.com (R. William Beckwith) writes: : Norman H. Cohen (ncohen@watson.ibm.com) wrote: : : their presence too. : : I was under the impression that any object that is initialize'd or : adjust'ed _will_ always get finalize'd. However, some objects may : (potentially) get finalize'd more than once and/or get finalize'd : without ever being initialize'd or adjust'ed. : : I have reference counting that depends on this behavior. : Am I safe? Lawyers? Compiler writers? : if your assumption is nb_init + nb_adjust <= nb_finalize you are safe from the compiler generated code point of view, but beware of sneaky users that would call directly Initialize (those operations better not be visible to the end programmer...) if your assumption is nb_init + nb_adjust = nb_finalize you are safe in the limited case only. As a matter of fact, in the non-limited case: My_Ctrl_Obj : My_Ctrl_Type := (Controlled with ....); will not generate a call to Initialize not Adjust (or if it does, in case an anonymous object is generated, then the anon must be finalized do there is still one more finalization) I must say that I have been very surprized to find out that a controlled object could be neither initialized nor adjusted... Cyrille -- ------------------------------------------------------------------------ Cyrille Comar, E-mail: comar@cs.nyu.edu Gnat Project US phone: (212) 998-3489