comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: On absurdity of collections 7.6.1 (11.1/3)
Date: Thu, 30 Sep 2021 10:49:11 +0200	[thread overview]
Message-ID: <sj3tm7$1um3$1@gioia.aioe.org> (raw)
In-Reply-To: lyy27ea2bv.fsf@pushface.org

On 2021-09-30 10:35, Simon Wright wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> 
>> It should print it twice, because Finalize must be called twice. Once
>> inside New_Item, then in Free.
> 
> That's in your implementation of Finalize, which you haven't shown us

    procedure Finalize (X : in out Item) is
    begin
       Put_Line (X.Text & " is dead");
    end Finalize;

P.S. You can use the standard pool:

    Ptr : Item_Ptr;
    type String_Ptr is access String;
begin
    Ptr := New_Item (String_Ptr'Storage_Pool, "A");
    Free (Ptr);

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2021-09-30  8:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29  9:09 On absurdity of collections 7.6.1 (11.1/3) Dmitry A. Kazakov
2021-09-29 11:05 ` Simon Wright
2021-09-29 11:20   ` Dmitry A. Kazakov
2021-09-29 21:38     ` Simon Wright
2021-09-30  8:07       ` Dmitry A. Kazakov
2021-09-30  8:35         ` Simon Wright
2021-09-30  8:49           ` Dmitry A. Kazakov [this message]
2021-10-01  1:37         ` Randy Brukardt
2021-10-01  7:57           ` Dmitry A. Kazakov
2021-09-30  0:23     ` Randy Brukardt
2021-09-30  8:06       ` Dmitry A. Kazakov
2021-09-30 18:23 ` G.B.
2021-09-30 18:52   ` Dmitry A. Kazakov
2021-10-01  1:40     ` Randy Brukardt
2021-10-01  7:57       ` Dmitry A. Kazakov
replies disabled

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