From mboxrd@z Thu Jan 1 00:00:00 1970
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Blady
Newsgroups: comp.lang.ada
Subject: Re: Unchecked_Deallocation with tagged class type.
Date: Thu, 16 Nov 2023 21:29:15 +0100
Organization: A noiseless patient Spider
Message-ID:
References:
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 16 Nov 2023 20:29:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c5ad3de8a0a64d0677585a386be4ce5b";
logging-data="2549974"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XDLm12Vs5qsgYpteKMB99"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:zffcTTE34W+rnCSC2sQkMh4rNyY=
Content-Language: fr, en-US
In-Reply-To:
Xref: news.eternal-september.org comp.lang.ada:65851
List-Id:
Le 15/11/2023 à 22:17, Dmitry A. Kazakov a écrit :
> On 2023-11-15 21:26, Blady wrote:
>> Le 14/11/2023 à 23:42, Dmitry A. Kazakov a écrit :
>>>> But what does "Finalize (OB);"?
<...>
> Regarding Unchecked_Deallocation instantiated with a pointer to a
> class-wide object, consider it dispatching on the target object tag.
> Thus you can deallocate any object using any instance of
> Unchecked_Deallocation for any class-wide parent of, interfaces included.
>
> So Finalize (OB) is OK.
>
Thanks, yes, the instanciation of Unchecked_Deallocation seemed to
indicate that but I was not able to confirm it from the Ada RM.
A mention in Ada RM 13.11.2 Unchecked Storage Deallocation of that
particular possibility would be valuable.
Regards, Pascal.
PS: after a quick search, I found also a smart answer with a full
example from Simon:
https://stackoverflow.com/questions/64951954/how-can-i-do-an-unchecked-deallocation-of-abstract-classes-in-ada