From: Jano <nono@celes.unizar.es>
Subject: Re: Weird controlled behavior - Gnat 3.15p NT
Date: Thu, 4 Sep 2003 22:57:48 +0200
Date: 2003-09-04T22:57:48+02:00 [thread overview]
Message-ID: <MPG.19c1affa943dfff2989754@News.CIS.DFN.DE> (raw)
In-Reply-To: MPG.19c1aaef652e6fc2989753@News.CIS.DFN.DE
Jano dice...
> Patrice Freydiere dice...
> > On Thu, 04 Sep 2003 08:25:41 +0000, Jano wrote:
> >
> > > Hello,
> > >
> > > see the following type declarations and lines of code:
> > >
> > > type Object is abstract new
> > > Finalization.Controlled with null record;
> > > type Object_access is access all Object'Class;
> > >
> > > procedure Initialize (This : in out Object) is
> > > begin
> > > Trace.Log ("====>");
> > > end Initialize;
> > >
> > > procedure Finalize (This : in out Object) is
> > > begin
> > > Trace.Log ("<====");
> > > end Finalize;
> > >
> > > declare
> > > -- THIS LINE IS THE RELEVANT ONE.
> > > Thing : Object_access :=
> > > new Object'Class'(Object'Class'Input (Stream));
> > > begin
> > > null;
> > > end;
> > >
> > > Ok, running normally or stepping with GVD when the line with the
> > > stream reading is executed I get the following log:
> > >
> > > ====>
> > > <====
> > > <====
> > > <====
> > >
> > > Compiled with -O2 and without it if that means something. Consistently
> > > with each object in the stream.
> > >
> > > Now, I would assume that no Finalization could happen without a
> > > corresponding Initialization, so is this normal? Is something wrong in
> > > that read way?
> > >
> > > Regards,
> > >
> > > A. Mosteo.
> >
> >
> > is it related to assign ??
> > can you log assign call , for the controlled type ??
>
> Assign isn't overloaded, but I'll try it to see what happens.
Well, the sequence with Assign traced is:
====> (Initialize)
=***= (Adjust)
<==== (Finalize)
=***=
=***=
<====
<====
and that for each read item.
--
-------------------------
Jano
402450.at.cepsz.unizar.es
-------------------------
next prev parent reply other threads:[~2003-09-04 20:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-04 15:25 Weird controlled behavior - Gnat 3.15p NT Jano
2003-09-04 15:40 ` Martin Krischik
2003-09-04 18:06 ` Patrice Freydiere
2003-09-04 19:03 ` Jano
2003-09-04 20:57 ` Jano [this message]
2003-09-05 8:48 ` Preben Randhol
2003-09-05 13:48 ` Jano
2003-09-04 21:36 ` Robert I. Eachus
2003-09-05 4:04 ` Randy Brukardt
2003-09-05 13:48 ` Jano
2003-09-05 14:33 ` Dmitry A. Kazakov
2003-09-09 2:01 ` Hyman Rosen
2003-09-09 7:02 ` Jean-Pierre Rosen
2003-09-11 3:40 ` Hyman Rosen
2003-09-09 8:22 ` Dmitry A. Kazakov
2003-09-11 3:46 ` Hyman Rosen
2003-09-11 8:23 ` Dmitry A. Kazakov
2003-09-05 7:10 ` Jean-Pierre Rosen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox