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 X-Google-Thread: 103376,f196003f7b36852b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-25 08:58:34 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!129.240.148.23!uio.no!uninett.no!ntnu.no!randhol+abuse From: randhol+abuse@pvv.org (Preben Randhol) Newsgroups: comp.lang.ada Subject: Re: Question about Finalization Control and reference counting Date: Wed, 25 Apr 2001 15:58:33 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <3AE5A5B5.4337CE90@boeing.com> NNTP-Posting-Host: kiuk0156.chembio.ntnu.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: tyfon.itea.ntnu.no 988214313 16715 129.241.83.82 (25 Apr 2001 15:58:33 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Wed, 25 Apr 2001 15:58:33 +0000 (UTC) User-Agent: slrn/0.9.7.0 (Linux) Xref: newsfeed.google.com comp.lang.ada:6929 Date: 2001-04-25T15:58:33+00:00 List-Id: On Tue, 24 Apr 2001 16:11:33 GMT, Jeffrey Carter wrote: > Adjust only applies to a controlled type, so you need to put your access > value inside a controlled type: > > type Node; > > type Node_Ptr is access all Node; > > type Node is new [Limited_]Controlled with record > Prev : Node_Ptr; > Data : Whatever; > Count : Natural := 0; > Next : Node_Ptr; > end record; > > procedure Adjust (Object : in out Node); > > procedure Finalize (Object : in out Node); But the problem is that if you have : Node1 : Node_Ptr; Node2 : Node_Ptr; Node3 : Node; ... After making the Nodes with new you: Node1.Next := Node2; Then Adjust of Node2 won't be called it will only be called if you do: Node3 := Node1.all; if I understand things correctly. I think I need to rethink my problem in a more Ada approach :-) -- Preben Randhol ------------------- http://www.pvv.org/~randhol/ -- �For me, Ada95 puts back the joy in programming.�