comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jeffrey.carter@boeing.com>
Subject: Re: Question about Finalization Control and reference counting
Date: Tue, 24 Apr 2001 16:11:33 GMT
Date: 2001-04-24T16:11:33+00:00	[thread overview]
Message-ID: <3AE5A5B5.4337CE90@boeing.com> (raw)
In-Reply-To: slrn9e3072.aah.randhol+abuse@kiuk0156.chembio.ntnu.no

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);

For a doubly linked list like this, you probably don't need a reference
count or Adjust. See the PragmAda Reusable Components
(PragmARC.List_Unbounded_Unprotected) for just such a list.



  reply	other threads:[~2001-04-24 16:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-21 12:37 Question about Finalization Control and reference counting Preben Randhol
2001-04-21 12:44 ` Preben Randhol
2001-04-24 16:11   ` Jeffrey Carter [this message]
2001-04-25 15:58     ` Preben Randhol
2001-04-25 16:01       ` Preben Randhol
2001-04-25 22:22       ` Jeffrey Carter
2001-04-26  8:50         ` Preben Randhol
2001-04-25 16:57     ` Stanley R. Allen
2001-04-24 16:10 ` Alexander Boucke
2001-04-25  3:14 ` DuckE
  -- strict thread matches above, loose matches on Subject: below --
2001-04-25 11:08 Christoph Grein
replies disabled

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