comp.lang.ada
 help / color / mirror / Atom feed
From: comar@cs.nyu.edu (Cyrille Comar)
Subject: Re: Question regarding LRM 5.95 7.6(19)
Date: 19 Jan 1995 19:44:21 -0500
Date: 1995-01-19T19:44:21-05:00	[thread overview]
Message-ID: <3fn115$66n@lang8.cs.nyu.edu> (raw)
In-Reply-To: 3fjodr$99j@gamma.ois.com

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




  reply	other threads:[~1995-01-20  0:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <leschkes.790279202@ferret>
     [not found] ` <3fgik5$1fn0@watnews1.watson.ibm.com>
1995-01-18 18:59   ` Question regarding LRM 5.95 7.6(19) R. William Beckwith
1995-01-20  0:44     ` Cyrille Comar [this message]
1995-01-21 17:35       ` Tucker Taft
1995-01-23 10:45         ` Robb Nebbe
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox