comp.lang.ada
 help / color / mirror / Atom feed
From: Blady <p.p11@orange.fr>
Subject: Re: Unchecked_Deallocation with tagged class type.
Date: Thu, 16 Nov 2023 21:29:15 +0100	[thread overview]
Message-ID: <uj5u2s$2dq6m$1@dont-email.me> (raw)
In-Reply-To: <uj3chf$1tbp8$1@dont-email.me>

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

  reply	other threads:[~2023-11-16 20:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 21:11 Unchecked_Deallocation with tagged class type Blady
2023-11-14 22:42 ` Dmitry A. Kazakov
2023-11-15 20:26   ` Blady
2023-11-15 21:17     ` Dmitry A. Kazakov
2023-11-16 20:29       ` Blady [this message]
2023-11-17 13:12         ` AdaMagica
2023-11-17 13:13           ` AdaMagica
replies disabled

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