comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: On absurdity of collections 7.6.1 (11.1/3)
Date: Thu, 30 Sep 2021 20:37:52 -0500	[thread overview]
Message-ID: <sj5oph$qss$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: sj3r7l$pla$2@gioia.aioe.org

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:sj3r7l$pla$2@gioia.aioe.org...
...
> Yes, every general access type that permits instantiation of 
> Unchecked_Dellocation must indicate the target object's pool, directly, 
> e.g. per fat pointer, or indirectly by some other schema. I see nothing in 
> RM that allows a different implementation. But it is could be a bug by 
> omission and I am not a language lawyer anyway.

Each access type has only one pool, and all allocations and deallocations 
for that access type use that pool. You can see at RM 13.11(13) that you can 
retrieve the storage pool of T, that wouldn't be possible if it could have 
multiple pools. Allocation for T uses T'Storage_Pool (RM 13.11(16)), and 
deallocation for T also uses T'Storage_Pool (13.11.2(9/3) - I see this 
wording isn't as clear as it could be, but "the storage_pool" here is the 
one for the type T. It is clear, however, from 13.11.2(16/3) that it is 
erroneous to deallocate an object for some other pool than the pool of the 
access type passed to the instance of Unchecked_Deallocation.

Surely no one would expect the pool to be associated with the object -- it 
would be impossible to interface to C or most other languages that way. Note 
that GNAT insists that all access types are C-compatible.

As I've said repeatedly, if you want the behavior of multiple pools with a 
single access type, you have to use the subpool mechanism somehow.

                          Randy.


  parent reply	other threads:[~2021-10-01  1:37 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
2021-10-01  1:37         ` Randy Brukardt [this message]
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