Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The moon may be smaller than Earth, but it's further away.


devel / comp.lang.ada / Re: Custom Storage Pool questions

SubjectAuthor
* Custom Storage Pool questionsJere
+* Re: Custom Storage Pool questionsRandy Brukardt
|+* Re: Custom Storage Pool questionsJere
||`- Re: Custom Storage Pool questionsRandy Brukardt
|+- Re: Custom Storage Pool questionsSimon Wright
|`* Re: Custom Storage Pool questionsJere
| `* Re: Custom Storage Pool questionsNiklas Holsti
|  `* Re: Custom Storage Pool questionsEmmanuel Briot
|   +- Re: Custom Storage Pool questionsDmitry A. Kazakov
|   +- Re: Custom Storage Pool questionsShark8
|   `* Re: Custom Storage Pool questionsRandy Brukardt
|    `* Re: Custom Storage Pool questionsJere
|     `* Re: Custom Storage Pool questionsRandy Brukardt
|      `* Re: Custom Storage Pool questionsJere
|       `* Re: Custom Storage Pool questionsDmitry A. Kazakov
|        `- Re: Custom Storage Pool questionsRandy Brukardt
+* Re: Custom Storage Pool questionsJ-P. Rosen
|`* Re: Custom Storage Pool questionsJere
| +* Re: Custom Storage Pool questionsJ-P. Rosen
| |`* Re: Custom Storage Pool questionsJere
| | `* Re: Custom Storage Pool questionsSimon Wright
| |  `* Re: Custom Storage Pool questionsJere
| |   `* Re: Custom Storage Pool questionsRandy Brukardt
| |    `- Re: Custom Storage Pool questionsJere
| +* Re: Custom Storage Pool questionsDmitry A. Kazakov
| |+* Re: Custom Storage Pool questionsJ-P. Rosen
| ||+- Re: Custom Storage Pool questionsDmitry A. Kazakov
| ||`- Re: Custom Storage Pool questionsRandy Brukardt
| |+* Re: Custom Storage Pool questionsJere
| ||`- Re: Custom Storage Pool questionsDmitry A. Kazakov
| |`- Re: Custom Storage Pool questionsRandy Brukardt
| `* Re: Custom Storage Pool questionsEgil H H
|  `- Re: Custom Storage Pool questionsJere
`* Re: Custom Storage Pool questionsSimon Wright
 +- Re: Custom Storage Pool questionsSimon Wright
 `* Re: Custom Storage Pool questionsDmitry A. Kazakov
  `* Re: Custom Storage Pool questionsSimon Wright
   +* Re: Custom Storage Pool questionsEmmanuel Briot
   |`* Re: Custom Storage Pool questionsJere
   | +- Re: Custom Storage Pool questionsEmmanuel Briot
   | +- Re: Custom Storage Pool questionsSimon Wright
   | `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |  `* Re: Custom Storage Pool questionsSimon Wright
   |   `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    +* Re: Custom Storage Pool questionsNiklas Holsti
   |    |`* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | +* Re: Custom Storage Pool questionsNiklas Holsti
   |    | |`* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | | +* Re: Custom Storage Pool questionsNiklas Holsti
   |    | | |`* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | | | `* Re: Custom Storage Pool questionsNiklas Holsti
   |    | | |  `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | | |   +* Re: Custom Storage Pool questionsNiklas Holsti
   |    | | |   |`* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | | |   | `* Re: Custom Storage Pool questionsNiklas Holsti
   |    | | |   |  +* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | | |   |  |`- Re: Custom Storage Pool questionsRandy Brukardt
   |    | | |   |  `- Re: Custom Storage Pool questionsRandy Brukardt
   |    | | |   +- Re: Custom Storage Pool questionsRandy Brukardt
   |    | | |   `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | | |    `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | | |     `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | | |      `- Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | | `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | |  `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |   `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | |    `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |     `* Re: Custom Storage Pool questionsSimon Wright
   |    | |      `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |       `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | |        `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |         `* Re: Custom Storage Pool questionsShark8
   |    | |          `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |           `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | |            `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |             `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | |              `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |               `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | |                `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |                 `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | |                  `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |                   `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | |                    +- Re: Custom Storage Pool questionsphilip...@gmail.com
   |    | |                    `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |                     `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | |                      +* Re: Custom Storage Pool questionsStephen Leake
   |    | |                      |+- Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |                      |`- Re: Custom Storage Pool questionsRandy Brukardt
   |    | |                      `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |                       `* Re: Custom Storage Pool questionsRandy Brukardt
   |    | |                        `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |                         `* Re: Custom Storage Pool questionsSimon Wright
   |    | |                          `* Re: Custom Storage Pool questionsDmitry A. Kazakov
   |    | |                           `- Re: Custom Storage Pool questionsShark8
   |    | `- Re: Custom Storage Pool questionsRandy Brukardt
   |    `- Re: Custom Storage Pool questionsRandy Brukardt
   `- Re: Custom Storage Pool questionsDmitry A. Kazakov

Pages:1234
Re: Custom Storage Pool questions

<sib8co$n7g$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5968&group=comp.lang.ada#5968

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsfeed.xs3.de!callisto.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Mon, 20 Sep 2021 19:18:31 -0500
Organization: JSA Research & Innovation
Lines: 47
Message-ID: <sib8co$n7g$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org> <lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com> <c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org>
Injection-Date: Tue, 21 Sep 2021 00:18:32 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="23792"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 21 Sep 2021 00:18 UTC

Janus/Ada uses chains for everything; there is no attempt to do anything
else. They make dealing with partially initialized objects (when some
initialization fails) much easier, and are strongly related to the lists of
allocated memory that Janus/Ada uses anyway.

It's easy to deal with a stand-alone controlled object, but when you have
components of dynamic components of dynamically sized object and have to
deal with failures and allocated objects, the headaches just aren't worth it
(IMHO). The cost is insignificant unless you actually have controlled
objects, so you only pay for what you use (to steal a line from a commercial
that runs far too often in the US).

Randy.

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:si2ud7$fv2$1@gioia.aioe.org...
> On 2021-09-17 21:46, Simon Wright wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>>
>>> Nope, especially because the issue with X'Address being unusable for
>>> memory pool developers is a long standing painful problem that need to
>>> be resolved. That will never happen until a measurable group of people
>>> start asking questions. So you are doubly welcome.
>>
>> There are two attributes that we should all have known about,
>> Descriptor_Size[1] (bits, introduced in 2011) and Finalization_Size[2]
>> (storage units, I think, introduced in 2017)
>
> They are non-standard and have murky semantics I doubt anybody really
> cares about.
>
> What is needed is the address passed to Deallocate should the object be
> freed = the address returned by Allocate. Is that too much to ask?
>
> BTW, finalization lists (#2) should have been removed from the language
> long ago. They have absolutely no use, except maybe for debugging, and
> introduce huge overhead. The semantics should have been either
> Unchecked_Deallocation or compiler allocated objects/components may call
> Finalize, nothing else.
>
> --
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

Re: Custom Storage Pool questions

<sib8er$n7l$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5969&group=comp.lang.ada#5969

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsfeed.xs3.de!callisto.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Mon, 20 Sep 2021 19:19:38 -0500
Organization: JSA Research & Innovation
Lines: 55
Message-ID: <sib8er$n7l$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org> <lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com> <c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net> <si45ls$1goa$1@gioia.aioe.org>
Injection-Date: Tue, 21 Sep 2021 00:19:39 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="23797"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 21 Sep 2021 00:19 UTC

There is: Restriction No_Controlled_Types. - Randy

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:si45ls$1goa$1@gioia.aioe.org...
> On 2021-09-17 23:17, Niklas Holsti wrote:
>> On 2021-09-17 23:39, Dmitry A. Kazakov wrote:
>>> On 2021-09-17 21:46, Simon Wright wrote:
>>>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>>>>
>>>>> Nope, especially because the issue with X'Address being unusable for
>>>>> memory pool developers is a long standing painful problem that need to
>>>>> be resolved. That will never happen until a measurable group of people
>>>>> start asking questions. So you are doubly welcome.
>>>>
>>>> There are two attributes that we should all have known about,
>>>> Descriptor_Size[1] (bits, introduced in 2011) and Finalization_Size[2]
>>>> (storage units, I think, introduced in 2017)
>>>
>>> They are non-standard and have murky semantics I doubt anybody really
>>> cares about.
>>>
>>> What is needed is the address passed to Deallocate should the object be
>>> freed = the address returned by Allocate. Is that too much to ask?
>>
>> That is already required by RM 13.11(21.7/3): "The value of the
>> Storage_Address parameter for a call to Deallocate is the value returned
>> in the Storage_Address parameter of the corresponding successful call to
>> Allocate."
>
> You missed the discussion totally. It is about X'Address attribute.
>
> The challenge: write pool with a function returning object allocation time
> by its pool-specific access type.
>
>>> BTW, finalization lists (#2) should have been removed from the language
>>> long ago.
>>
>> Huh? Where does the RM _require_ finalization lists?
>
> 7.6.1 (11 1/3)
>
>> I see them mentioned here and there as a _possible_ implementation
>> technique, and an alternative "PC-map" technique is described in RM 7.6.1
>> (24.r .. 24.t).
>
> I don't care about techniques to implement meaningless stuff. It should be
> out, at least there must be a representation aspect for turning this mess
> off.
>
> --
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

Re: Custom Storage Pool questions

<sib8rc$nda$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5970&group=comp.lang.ada#5970

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsfeed.xs3.de!callisto.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Mon, 20 Sep 2021 19:26:19 -0500
Organization: JSA Research & Innovation
Lines: 33
Message-ID: <sib8rc$nda$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org> <lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com> <c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net> <si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net> <si4ell$1b25$1@gioia.aioe.org>
Injection-Date: Tue, 21 Sep 2021 00:26:21 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="23978"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 21 Sep 2021 00:26 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:si4ell$1b25$1@gioia.aioe.org...
....
>> Given that an object can be allocated in multiple independent pieces, it
>> seems unlikely that what you want will be provided.
>
> Such implementations would automatically disqualify the compiler.
> Compiler-generated piecewise allocation is OK for the stack, not for user
> storage pools.

If someone wants to require contigious allocation of objects, there should
be a representation attribute to specify it. And there should not be an
nonsense restrictions on records with defaulted discriminants unless you
specify that you require contiguous allocation. There is no good reason to
need that for 99% of objects, why insist on a very expensive implementation
of slices/unconstrained arrays unless it's required??

....
> No, it is about the overhead of maintaining "collections" associated with
> an access type in order to call Finalization for all members of the
> collection.

How else would you ensure that Finalize is always called on an allocated
object? Unchecked_Deallocation need not be called on an allocated object.
The Ada model is that Finalize will ALWAYS be called on every controlled
object before the program ends; there are no "leaks" of finalization.
Otherwise, one cannot depend on finalization for anything important; you
would often leak resources (especially for simple kernels that don't try to
free unreleased resources themselves).

Randy.

Re: Custom Storage Pool questions

<sib93i$nif$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5971&group=comp.lang.ada#5971

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsfeed.xs3.de!callisto.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Mon, 20 Sep 2021 19:30:41 -0500
Organization: JSA Research & Innovation
Lines: 29
Message-ID: <sib93i$nif$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org> <lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com> <c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net> <si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net> <si4ell$1b25$1@gioia.aioe.org> <iqmgn0F8ftgU1@mid.individual.net> <si53ia$1vat$1@gioia.aioe.org> <iqoi4rFkbu6U1@mid.individual.net> <si77kd$rka$1@gioia.aioe.org>
Injection-Date: Tue, 21 Sep 2021 00:30:43 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="24143"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 21 Sep 2021 00:30 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:si77kd$rka$1@gioia.aioe.org...
> On 2021-09-19 12:36, Niklas Holsti wrote:
....
>> Local variables declared in a subprogram are also not explicitly freed
>> (deallocated), yet they are automatically finalized when the subprogram
>> returns.
>
> Local objects are certainly freed. Explicit or not, aggregated or not, is
> irrelevant.

OK...

>> My understanding of Ada semantic principles is that any object that is
>> initialized should also be finalized.
>
> IFF deallocated.

....as you note above for stack objects, all objects are conceptually
deallocated. Whether the memory is actually returned to a storage pool is
irrelevant.

The original Ada model was that Unchecked_Deallocation is something to be
avoided if at all possible (thus the name), one would never want to tie
finalization to such a thing.

Randy.

Re: Custom Storage Pool questions

<sib9h5$njl$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5972&group=comp.lang.ada#5972

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsfeed.xs3.de!callisto.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Mon, 20 Sep 2021 19:37:56 -0500
Organization: JSA Research & Innovation
Lines: 40
Message-ID: <sib9h5$njl$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org> <lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com> <c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net> <si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net> <si4ell$1b25$1@gioia.aioe.org> <iqmgn0F8ftgU1@mid.individual.net> <si53ia$1vat$1@gioia.aioe.org> <iqoi4rFkbu6U1@mid.individual.net> <si77kd$rka$1@gioia.aioe.org>
Injection-Date: Tue, 21 Sep 2021 00:37:57 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="24181"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 21 Sep 2021 00:37 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:si77kd$rka$1@gioia.aioe.org...
....
> 1. It is a massive overhead in both memory and performance terms with no
> purpose whatsoever. I fail to see where that sort of thing might be even
> marginally useful.

The classic example of Finalization is file management on a simple kernel (I
use CP/M as the example in my head). CP/M did not try to recover any
resources on program exit, it was the programs responsibility to recover
them all (or reboot after every run). If you had holes in finalization, you
would easily leak files and since you could only open a limited number of
them at a time, you could easily make a system non-responsive.

You get similar things on some embedded kernels.

If you only write programs that live in ROM and never, ever terminate, then
you probably have different requirements. Most likely, you shouldn't be
using Finalization at all (or at least not putting such object in allocated
things).

....
> 2. What is worse that a collection is not bound to the pool. It is to an
> access type, which may have a narrower scope. So the user could declare an
> unfortunate access type, which would corrupt objects in the pool and the
> pool designer has no means to prevent that.

Pools are extremely low-level things that cannot be safe in any sense of the
word. A badly designed pool will corrupt everything. Using a pool with the
"wrong" access type generally has to be programmed for (as I answered
earlier, if I assume anything about allocations, I check for violations and
do something else.) And a pool can be used with many access types; many
useful ones are.

Some of what you want is provided by the subpool mechanism, but it is even
more complex at runtime, so it probably doesn't help you.

Randy.

Re: Custom Storage Pool questions

<sib9lk$nk2$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5973&group=comp.lang.ada#5973

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsfeed.xs3.de!callisto.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Mon, 20 Sep 2021 19:40:18 -0500
Organization: JSA Research & Innovation
Lines: 35
Message-ID: <sib9lk$nk2$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org> <lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com> <c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net> <si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net> <si4ell$1b25$1@gioia.aioe.org> <iqmgn0F8ftgU1@mid.individual.net> <si53ia$1vat$1@gioia.aioe.org> <iqoi4rFkbu6U1@mid.individual.net> <si77kd$rka$1@gioia.aioe.org> <iqqq5aF2vspU1@mid.individual.net> <si9dk7$pop$2@gioia.aioe.org> <iqqtskF3losU1@mid.individual.net>
Injection-Date: Tue, 21 Sep 2021 00:40:21 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="24194"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 21 Sep 2021 00:40 UTC

"Niklas Holsti" <niklas.holsti@tidorum.invalid> wrote in message
news:iqqtskF3losU1@mid.individual.net...
> On 2021-09-20 10:35, Dmitry A. Kazakov wrote:
>> On 2021-09-20 09:05, Niklas Holsti wrote:
>
>
> [snipping context]
>
>
>>> However, your semantic argument (as opposed to the overhead argument)
>>> seems to be based on an assumption that the objects "left over" in a
>>> local collection, and which thus are inaccessible, will still, somehow,
>>> participate in the later execution of the program, which is why you say
>>> that finalizing those objects would "corrupt" them.
>>>
>>> It seems to me that such continued participation is possible only if the
>>> objects contain tasks or are accessed through some kind of unchecked
>>> programming. Do you agree?
>>
>> No. You can have them accessible over other access types with wider
>> scopes:
>>
>> Collection_Pointer := new X;
>> Global_Pointer := Collection_Pointer.all'Unchecked_Access;
>>
>
>
> So, unchecked programming, as I said.

Yup, and when you do stuff like that, you deserve for the compiler to shoot
you in the head.

Randy.

Re: Custom Storage Pool questions

<sib9va$nqa$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5974&group=comp.lang.ada#5974

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.swapon.de!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Mon, 20 Sep 2021 19:45:28 -0500
Organization: JSA Research & Innovation
Lines: 48
Message-ID: <sib9va$nqa$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org> <lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com> <c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net> <si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net> <si4ell$1b25$1@gioia.aioe.org> <iqmgn0F8ftgU1@mid.individual.net> <si53ia$1vat$1@gioia.aioe.org> <iqoi4rFkbu6U1@mid.individual.net> <si77kd$rka$1@gioia.aioe.org> <iqqq5aF2vspU1@mid.individual.net> <si9dk7$pop$2@gioia.aioe.org> <iqqtskF3losU1@mid.individual.net> <si9gnb$926$1@gioia.aioe.org>
Injection-Date: Tue, 21 Sep 2021 00:45:30 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="24394"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 21 Sep 2021 00:45 UTC

User calls on Initialize and Finalize have no special meaning; they're
igorned for the purposes of language-defined finalization. The fact that
they're normal routines and can be called by someone else means that some
defensive programming is needed. That all happened because of the "scope
reduction" of Ada 9x; the dedicated creation/finalization mechanism got
dumped. Finalization was too important to lose completely, so Tucker cooked
up the current much simpler mechanism in order to avoid the objections. It's
not ideal for that reason -- but Finalize would still have been a normal
subprogram that anyone could call (what else could it have been -- the
mechanism of stream attributes could have been used instead). I don't think
there is a way that one could have prevented user-defined calls to these
routines (even if they had a special name, you still could have renamed an
existing subprogram to the special name).

Randy.

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:si9gnb$926$1@gioia.aioe.org...
> On 2021-09-20 10:08, Niklas Holsti wrote:
>> On 2021-09-20 10:35, Dmitry A. Kazakov wrote:
>
>>> No. You can have them accessible over other access types with wider
>>> scopes:
>>>
>>> Collection_Pointer := new X;
>>> Global_Pointer := Collection_Pointer.all'Unchecked_Access;
>>>
>> So, unchecked programming, as I said.
>
> Right, working with pools is all that thing. Maybe "new" should be named
> "unchecked_new" (:-))
>
> Finalize and Initialize certainly should have been Unchecked_Finalize and
> Unchecked_Initialize as they are not enforced. You can override the
> parent's Initialize and never call it. It is a plain primitive operations
> anybody can call any time any place. You can even call it before the
> object is fully initialized!
>
> So, why bother with objects the user manually allocates (and forgets to
> free)?
>
> --
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

Re: Custom Storage Pool questions

<siba8v$nvh$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5975&group=comp.lang.ada#5975

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsfeed.xs3.de!callisto.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Mon, 20 Sep 2021 19:50:38 -0500
Organization: JSA Research & Innovation
Lines: 30
Message-ID: <siba8v$nvh$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <shmnk1$lgf$1@franka.jacob-sparre.dk> <9bc55d72-b90e-45c5-bfd8-cbce565d139dn@googlegroups.com> <iqqoc7F2lr8U1@mid.individual.net> <44be7c73-f69e-45da-9916-b14a43a05ea3n@googlegroups.com>
Injection-Date: Tue, 21 Sep 2021 00:50:39 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="24561"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 21 Sep 2021 00:50 UTC

A better solution would be to know the size of those bounds objects and
treat them differently (I've done that). And the next allocation is going to
be the data, so I don't do anything special for them. Probably would be nice
to have an attribute for that. But no one has ever asked for any such thing,
so I haven't defined anything.

Such pools are highly implementation specific, so I haven't worried about
this much..

Randy.

"Emmanuel Briot" <briot.emmanuel@gmail.com> wrote in message
news:44be7c73-f69e-45da-9916-b14a43a05ea3n@googlegroups.com...
>> > If a compiler is allowed to break up an allocation into multiple
>> > calls to Allocate (and of course Deallocate), how does one go about
>> > enforcing that the user's header is only created once?
>> I think one cannot enforce that, because the calls to Allocate do not
>> indicate (with parameters) which set of calls concern the same object
>> allocation.
>
> I think the only solution would be for this compiler to have another
> attribute similar to 'Storage_Pool, but that would define the pool for the
> descriptor:
>
> for X'Storage_Pool use Pool;
> for X'Descriptor_Storage_Pool use Other_Pool;
>
> That way the user can decide when to add (or not) extra headers.

Re: Custom Storage Pool questions

<sibu1t$12ds$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5976&group=comp.lang.ada#5976

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Tue, 21 Sep 2021 08:28:13 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sibu1t$12ds$1@gioia.aioe.org>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org>
<lywnnha7y1.fsf@pushface.org>
<1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com>
<c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com>
<si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org>
<si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net>
<si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net>
<si4ell$1b25$1@gioia.aioe.org> <iqmgn0F8ftgU1@mid.individual.net>
<si53ia$1vat$1@gioia.aioe.org> <iqoi4rFkbu6U1@mid.individual.net>
<si77kd$rka$1@gioia.aioe.org> <sib9h5$njl$1@franka.jacob-sparre.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="35260"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Tue, 21 Sep 2021 06:28 UTC

On 2021-09-21 02:37, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:si77kd$rka$1@gioia.aioe.org...
> ...
>> 1. It is a massive overhead in both memory and performance terms with no
>> purpose whatsoever. I fail to see where that sort of thing might be even
>> marginally useful.
>
> The classic example of Finalization is file management on a simple kernel (I
> use CP/M as the example in my head). CP/M did not try to recover any
> resources on program exit, it was the programs responsibility to recover
> them all (or reboot after every run). If you had holes in finalization, you
> would easily leak files and since you could only open a limited number of
> them at a time, you could easily make a system non-responsive.

This is why system resources are handled by the OS rather than by the
application. But I do not see how this justifies "collections."

>> 2. What is worse that a collection is not bound to the pool. It is to an
>> access type, which may have a narrower scope. So the user could declare an
>> unfortunate access type, which would corrupt objects in the pool and the
>> pool designer has no means to prevent that.
>
> Pools are extremely low-level things that cannot be safe in any sense of the
> word. A badly designed pool will corrupt everything. Using a pool with the
> "wrong" access type generally has to be programmed for (as I answered
> earlier, if I assume anything about allocations, I check for violations and
> do something else.) And a pool can be used with many access types; many
> useful ones are.

This is also true, but again unrelated to the point that tying
finalization *without* deallocation to a pointer type is just wrong,
semantically on any abstraction level.

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

Re: Custom Storage Pool questions

<sibvcr$1ico$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5978&group=comp.lang.ada#5978

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Tue, 21 Sep 2021 08:51:08 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sibvcr$1ico$1@gioia.aioe.org>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org>
<lywnnha7y1.fsf@pushface.org>
<1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com>
<c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com>
<si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org>
<si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net>
<si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net>
<si4ell$1b25$1@gioia.aioe.org> <sib8rc$nda$1@franka.jacob-sparre.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="51608"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Tue, 21 Sep 2021 06:51 UTC

On 2021-09-21 02:26, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:si4ell$1b25$1@gioia.aioe.org...
> ...
>>> Given that an object can be allocated in multiple independent pieces, it
>>> seems unlikely that what you want will be provided.
>>
>> Such implementations would automatically disqualify the compiler.
>> Compiler-generated piecewise allocation is OK for the stack, not for user
>> storage pools.
>
> If someone wants to require contigious allocation of objects, there should
> be a representation attribute to specify it.

It would be difficult, because the types are declared prior to pools.
That is when object layout does change.

If the layout does not then you need no attribute.

You can always run a mock allocation to compute overall size and offsets
to the pieces and then do one true allocation. And with stream
attributes you need to implement introspection anyway. So this might
have been an issue for Ada 83, but now one can simply require contiguous
allocation in pools.

> And there should not be an
> nonsense restrictions on records with defaulted discriminants unless you
> specify that you require contiguous allocation.

You can keep the object layout. It is only the question of "trolling"
the pool, no how objects are represented there.

>> No, it is about the overhead of maintaining "collections" associated with
>> an access type in order to call Finalization for all members of the
>> collection.
>
> How else would you ensure that Finalize is always called on an allocated
> object?

I would not, because it is plain wrong. Finalize must be called for each
*deallocated* object.

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

Re: Custom Storage Pool questions

<c784164c-b27c-4ba4-9958-ca750175fec4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5985&group=comp.lang.ada#5985

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:a13:: with SMTP id 19mr3844325qkk.497.1632264016902;
Tue, 21 Sep 2021 15:40:16 -0700 (PDT)
X-Received: by 2002:a25:8409:: with SMTP id u9mr30220900ybk.159.1632264016707;
Tue, 21 Sep 2021 15:40:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Tue, 21 Sep 2021 15:40:16 -0700 (PDT)
In-Reply-To: <sib6pj$mni$1@franka.jacob-sparre.dk>
Injection-Info: google-groups.googlegroups.com; posting-host=98.118.241.166; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf
NNTP-Posting-Host: 98.118.241.166
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<shnbn8$5he$1@dont-email.me> <bec26cfe-a7c3-49b9-8272-9f08be93d7fdn@googlegroups.com>
<shpe9f$17j$1@dont-email.me> <75749f8d-0f2c-45ef-b45f-fe55500d6bf8n@googlegroups.com>
<lyee9qb9up.fsf@pushface.org> <96e7199f-c354-402f-a6c6-2a0e042b6747n@googlegroups.com>
<sib6pj$mni$1@franka.jacob-sparre.dk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c784164c-b27c-4ba4-9958-ca750175fec4n@googlegroups.com>
Subject: Re: Custom Storage Pool questions
From: jhb.c...@gmail.com (Jere)
Injection-Date: Tue, 21 Sep 2021 22:40:16 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 45
 by: Jere - Tue, 21 Sep 2021 22:40 UTC

It's ok! I realize I am not great at wording questions, so I just assume
I asked it poorly. If it helps, your response did get me thinking more
about the specifics of contiguous allocation vs not and how it would
affect my design, which didn't even cross my mind before.

On Monday, September 20, 2021 at 7:51:17 PM UTC-4, Randy Brukardt wrote:
> Sorry about that, I didn't understand what you were asking. And I get
> defensive about people who think that a pool should get some specific Size
> (and only that size), so I leapt to a conclusion and answered accordingly.
>
> The compiler requests all of the memory IT needs, but if the pool needs some
> additional memory for it's purposes (pretty common), it will need to add
> that space itself. It's hard to imagine how it could be otherwise, I guess I
> would have thought that goes without saying. (And that rather proves that
> there is nothing that goes without saying.)
>
> Randy.
>
> "Jere" <> wrote in message
> news:96e7199f-c354-402f...@googlegroups.com...
> > On Wednesday, September 15, 2021 at 3:01:52 AM UTC-4, Simon Wright wrote:
> >> Jere <> writes:
> >>
> >> > Thanks for the response. I'm sorry for all the questions. That's how
> >> > I learn and I realize it isn't a popular way to learn in the
> >> > community, but I have always learned very differently than most.
> >> Seems to me you ask interesting questions which generate enlightening
> >> responses!
> > Thanks! though in this case, my question was ill formed after I missed a
> > detail
> > in the blog, so the mistake is on me. I will say I hold back some
> > questions
> > as it is very intimidating to ask on C.L.A. I mean the first response led
> > off
> > with "Not sure what you are expecting" so it is hard to know how to
> > formulate
> > a good question as I always seem to get some harsh responses (which I am
> > sure is because I asked the question poorly). I'm unfortunately a very
> > visual
> > person and words are not my forte and I feel like when I ask questions
> > about
> > the boundaries of the language I manage to put folks on the defensive. I
> > don't dislike Ada at all, it is my favorite language, but I think it is
> > hard to
> > craft questions on some topics without putting forth the impression that
> > I don't like it, at least with my limited ability to word craft.

Re: Custom Storage Pool questions

<6a073ced-4c3b-4e87-8063-555a93a5c3f6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5986&group=comp.lang.ada#5986

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:430c:: with SMTP id u12mr29277874qko.439.1632265737179;
Tue, 21 Sep 2021 16:08:57 -0700 (PDT)
X-Received: by 2002:a05:6902:124c:: with SMTP id t12mr39232847ybu.91.1632265737011;
Tue, 21 Sep 2021 16:08:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Tue, 21 Sep 2021 16:08:56 -0700 (PDT)
In-Reply-To: <siba8v$nvh$1@franka.jacob-sparre.dk>
Injection-Info: google-groups.googlegroups.com; posting-host=98.118.241.166; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf
NNTP-Posting-Host: 98.118.241.166
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<shmnk1$lgf$1@franka.jacob-sparre.dk> <9bc55d72-b90e-45c5-bfd8-cbce565d139dn@googlegroups.com>
<iqqoc7F2lr8U1@mid.individual.net> <44be7c73-f69e-45da-9916-b14a43a05ea3n@googlegroups.com>
<siba8v$nvh$1@franka.jacob-sparre.dk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6a073ced-4c3b-4e87-8063-555a93a5c3f6n@googlegroups.com>
Subject: Re: Custom Storage Pool questions
From: jhb.c...@gmail.com (Jere)
Injection-Date: Tue, 21 Sep 2021 23:08:57 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 58
 by: Jere - Tue, 21 Sep 2021 23:08 UTC

I think the only thing that misses is scenarios where the compiler vendor
isn't allocating a descriptor/bounds but is still using multiple allocations for the
object. I don't know if that is a practical use, but it is one the RM allows? If
so, it is probably more useful to know if a specific Allocate call is somehow
a unique call relative to the others (the first call, the last call, etc.) so that the
developer could earmark that one to be the one to add the custom header
to.

We can't change the Allocate specification since it is what it is, but is there
any consideration to adding functionality to the root storage pool type,
maybe a classwide function that lets the compiler developer set an internal
flag for that unique allocation and a classwide function for the storage
pool developer to see if that flag was set for the allocation. Or some other
mechanism. It seems like this would need to be some sort of runtime
mechanism if the multiple allocations can occur in the absence of needing
a descriptor or bounds.

Or maybe a generic version of the Storage_Pools package that allows a
header type to be specified, that gives the compiler vendor some
interface that easily facilitates allocating the header along side any object
at the time and place the vendor finds convenient, and provides the
custom storage pool implementer a means of knowing when that happens
so they can initialize the header in the allocate function that creates it.

I'm obviously not a compiler developer so I don't know the practicalness
of any of that. But I think one root problem for a custom storage pool
developer is "when is it safe to make a custom header for my object?".

On Monday, September 20, 2021 at 8:50:41 PM UTC-4, Randy Brukardt wrote:
> A better solution would be to know the size of those bounds objects and
> treat them differently (I've done that). And the next allocation is going to
> be the data, so I don't do anything special for them. Probably would be nice
> to have an attribute for that. But no one has ever asked for any such thing,
> so I haven't defined anything.
>
> Such pools are highly implementation specific, so I haven't worried about
> this much..
>
> Randy.
>
> "Emmanuel Briot" <> wrote in message
> news:44be7c73-f69e-45da...@googlegroups.com...
> >> > If a compiler is allowed to break up an allocation into multiple
> >> > calls to Allocate (and of course Deallocate), how does one go about
> >> > enforcing that the user's header is only created once?
> >> I think one cannot enforce that, because the calls to Allocate do not
> >> indicate (with parameters) which set of calls concern the same object
> >> allocation.
> >
> > I think the only solution would be for this compiler to have another
> > attribute similar to 'Storage_Pool, but that would define the pool for the
> > descriptor:
> >
> > for X'Storage_Pool use Pool;
> > for X'Descriptor_Storage_Pool use Other_Pool;
> >
> > That way the user can decide when to add (or not) extra headers.

Re: Custom Storage Pool questions

<siu5r7$st6$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6020&group=comp.lang.ada#6020

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Mon, 27 Sep 2021 23:31:34 -0500
Organization: JSA Research & Innovation
Lines: 55
Message-ID: <siu5r7$st6$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org> <lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com> <c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net> <si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net> <si4ell$1b25$1@gioia.aioe.org> <sib8rc$nda$1@franka.jacob-sparre.dk> <sibvcr$1ico$1@gioia.aioe.org>
Injection-Date: Tue, 28 Sep 2021 04:31:35 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="29606"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 28 Sep 2021 04:31 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:sibvcr$1ico$1@gioia.aioe.org...
> On 2021-09-21 02:26, Randy Brukardt wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>> news:si4ell$1b25$1@gioia.aioe.org...
>> ...
>>>> Given that an object can be allocated in multiple independent pieces,
>>>> it
>>>> seems unlikely that what you want will be provided.
>>>
>>> Such implementations would automatically disqualify the compiler.
>>> Compiler-generated piecewise allocation is OK for the stack, not for
>>> user
>>> storage pools.
>>
>> If someone wants to require contigious allocation of objects, there
>> should
>> be a representation attribute to specify it.
>
> It would be difficult, because the types are declared prior to pools. That
> is when object layout does change.
>
> If the layout does not then you need no attribute.
>
> You can always run a mock allocation to compute overall size and offsets
> to the pieces and then do one true allocation. And with stream attributes
> you need to implement introspection anyway. So this might have been an
> issue for Ada 83, but now one can simply require contiguous allocation in
> pools.
>
>> And there should not be an
>> nonsense restrictions on records with defaulted discriminants unless you
>> specify that you require contiguous allocation.
>
> You can keep the object layout. It is only the question of "trolling" the
> pool, no how objects are represented there.
>
>>> No, it is about the overhead of maintaining "collections" associated
>>> with
>>> an access type in order to call Finalization for all members of the
>>> collection.
>>
>> How else would you ensure that Finalize is always called on an allocated
>> object?
>
> I would not, because it is plain wrong. Finalize must be called for each
> *deallocated* object.

Deallocation is irrelevant. Finalization is called when objects are about to
be destroyed, by any method. Otherwise, you do not have watertight
finalization, and it is near impossible to use it for anything important.

Randy.

Re: Custom Storage Pool questions

<siu687$t3f$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6021&group=comp.lang.ada#6021

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsfeed.xs3.de!callisto.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Mon, 27 Sep 2021 23:38:30 -0500
Organization: JSA Research & Innovation
Lines: 62
Message-ID: <siu687$t3f$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org> <lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com> <c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net> <si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net> <si4ell$1b25$1@gioia.aioe.org> <iqmgn0F8ftgU1@mid.individual.net> <si53ia$1vat$1@gioia.aioe.org> <iqoi4rFkbu6U1@mid.individual.net> <si77kd$rka$1@gioia.aioe.org> <sib9h5$njl$1@franka.jacob-sparre.dk> <sibu1t$12ds$1@gioia.aioe.org>
Injection-Date: Tue, 28 Sep 2021 04:38:31 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="29807"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 28 Sep 2021 04:38 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:sibu1t$12ds$1@gioia.aioe.org...
> On 2021-09-21 02:37, Randy Brukardt wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>> news:si77kd$rka$1@gioia.aioe.org...
>> ...
>>> 1. It is a massive overhead in both memory and performance terms with no
>>> purpose whatsoever. I fail to see where that sort of thing might be even
>>> marginally useful.
>>
>> The classic example of Finalization is file management on a simple kernel
>> (I
>> use CP/M as the example in my head). CP/M did not try to recover any
>> resources on program exit, it was the programs responsibility to recover
>> them all (or reboot after every run). If you had holes in finalization,
>> you
>> would easily leak files and since you could only open a limited number of
>> them at a time, you could easily make a system non-responsive.
>
> This is why system resources are handled by the OS rather than by the
> application. But I do not see how this justifies "collections."

Ada programs need no OS; they're really only useful for (abstracted) I/O,
for everything else, they're mainly in the way.

>>> 2. What is worse that a collection is not bound to the pool. It is to an
>>> access type, which may have a narrower scope. So the user could declare
>>> an
>>> unfortunate access type, which would corrupt objects in the pool and the
>>> pool designer has no means to prevent that.
>>
>> Pools are extremely low-level things that cannot be safe in any sense of
>> the
>> word. A badly designed pool will corrupt everything. Using a pool with
>> the
>> "wrong" access type generally has to be programmed for (as I answered
>> earlier, if I assume anything about allocations, I check for violations
>> and
>> do something else.) And a pool can be used with many access types; many
>> useful ones are.
>
> This is also true, but again unrelated to the point that tying
> finalization *without* deallocation to a pointer type is just wrong,
> semantically on any abstraction level.

If you didn't finalize everything, then a system like Claw would not work,
since there would be objects that would have gotten destroyed (when the
access type goes out of scope) and would still be on the various active
object chains. (The whole reason that these things are controlled is so that
they can be added to and removed from object chains as needed.)

Now, you could say that no one should be declaring access types locally in
subprograms -- I'd agree with that, but it isn't Ada.

Even if your semantics only happened for library-level access types, then
you'd still have problems when library-level objects go away. I suppose you
could say those never go away either -- but again, that only makes sense for
programs that never terminate. On Windows, you would have a mess.

Randy.

Re: Custom Storage Pool questions

<siu6f6$t4e$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6022&group=comp.lang.ada#6022

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Mon, 27 Sep 2021 23:42:12 -0500
Organization: JSA Research & Innovation
Lines: 15
Message-ID: <siu6f6$t4e$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <shmnk1$lgf$1@franka.jacob-sparre.dk> <9bc55d72-b90e-45c5-bfd8-cbce565d139dn@googlegroups.com> <iqqoc7F2lr8U1@mid.individual.net> <44be7c73-f69e-45da-9916-b14a43a05ea3n@googlegroups.com> <siba8v$nvh$1@franka.jacob-sparre.dk> <6a073ced-4c3b-4e87-8063-555a93a5c3f6n@googlegroups.com>
Injection-Date: Tue, 28 Sep 2021 04:42:14 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="29838"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 28 Sep 2021 04:42 UTC

"Jere" <jhb.chat@gmail.com> wrote in message
news:6a073ced-4c3b-4e87-8063-555a93a5c3f6n@googlegroups.com...
....
> We can't change the Allocate specification since it is what it is, but is
> there
> any consideration to adding functionality to the root storage pool type,

We tried that as a solution for the user-defined dereference problem, and it
ended up going nowhere. Your problem is different but the issues of changing
the Storage_Pool spec remain. Not sure it could be made to work (one does
not want to force everyone to change their existing storage pools).

Randy.

Re: Custom Storage Pool questions

<siueba$efk$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6025&group=comp.lang.ada#6025

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Tue, 28 Sep 2021 08:56:41 +0200
Organization: Aioe.org NNTP Server
Message-ID: <siueba$efk$1@gioia.aioe.org>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org>
<lywnnha7y1.fsf@pushface.org>
<1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com>
<c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com>
<si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org>
<si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net>
<si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net>
<si4ell$1b25$1@gioia.aioe.org> <sib8rc$nda$1@franka.jacob-sparre.dk>
<sibvcr$1ico$1@gioia.aioe.org> <siu5r7$st6$1@franka.jacob-sparre.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="14836"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Tue, 28 Sep 2021 06:56 UTC

On 2021-09-28 06:31, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:sibvcr$1ico$1@gioia.aioe.org...
>> On 2021-09-21 02:26, Randy Brukardt wrote:

>>> How else would you ensure that Finalize is always called on an allocated
>>> object?
>>
>> I would not, because it is plain wrong. Finalize must be called for each
>> *deallocated* object.
>
> Deallocation is irrelevant. Finalization is called when objects are about to
> be destroyed, by any method.

And no object may be destroyed unless deallocated.

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

Re: Custom Storage Pool questions

<siuehi$efk$2@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6026&group=comp.lang.ada#6026

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Tue, 28 Sep 2021 09:00:01 +0200
Organization: Aioe.org NNTP Server
Message-ID: <siuehi$efk$2@gioia.aioe.org>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org>
<lywnnha7y1.fsf@pushface.org>
<1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com>
<c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com>
<si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org>
<si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net>
<si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net>
<si4ell$1b25$1@gioia.aioe.org> <iqmgn0F8ftgU1@mid.individual.net>
<si53ia$1vat$1@gioia.aioe.org> <iqoi4rFkbu6U1@mid.individual.net>
<si77kd$rka$1@gioia.aioe.org> <sib9h5$njl$1@franka.jacob-sparre.dk>
<sibu1t$12ds$1@gioia.aioe.org> <siu687$t3f$1@franka.jacob-sparre.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="14836"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Tue, 28 Sep 2021 07:00 UTC

On 2021-09-28 06:38, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:sibu1t$12ds$1@gioia.aioe.org...

>> This is also true, but again unrelated to the point that tying
>> finalization *without* deallocation to a pointer type is just wrong,
>> semantically on any abstraction level.
>
> If you didn't finalize everything, then a system like Claw would not work,
> since there would be objects that would have gotten destroyed (when the
> access type goes out of scope) and would still be on the various active
> object chains. (The whole reason that these things are controlled is so that
> they can be added to and removed from object chains as needed.)

I did not say that the pointer type going out of scope should free
objects allocated though it. I said that it should not finalize
anything. It must simply silently die not touching anything.

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

Re: Custom Storage Pool questions

<lymtnxb0hs.fsf@pushface.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6028&group=comp.lang.ada#6028

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!RKN7TKnHC01q0gdg6EhkbQ.user.46.165.242.75.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Tue, 28 Sep 2021 08:52:31 +0100
Organization: Aioe.org NNTP Server
Message-ID: <lymtnxb0hs.fsf@pushface.org>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org>
<lywnnha7y1.fsf@pushface.org>
<1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com>
<c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com>
<si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org>
<si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net>
<si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net>
<si4ell$1b25$1@gioia.aioe.org> <sib8rc$nda$1@franka.jacob-sparre.dk>
<sibvcr$1ico$1@gioia.aioe.org> <siu5r7$st6$1@franka.jacob-sparre.dk>
<siueba$efk$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="60879"; posting-host="RKN7TKnHC01q0gdg6EhkbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)
Cancel-Lock: sha1:ahtCH0kTVYvAvIyno9W1edHtth4=
X-Notice: Filtered by postfilter v. 0.9.2
 by: Simon Wright - Tue, 28 Sep 2021 07:52 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> On 2021-09-28 06:31, Randy Brukardt wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>> news:sibvcr$1ico$1@gioia.aioe.org...
>>> On 2021-09-21 02:26, Randy Brukardt wrote:
>
>>>> How else would you ensure that Finalize is always called on an allocated
>>>> object?
>>>
>>> I would not, because it is plain wrong. Finalize must be called for each
>>> *deallocated* object.
>> Deallocation is irrelevant. Finalization is called when objects are
>> about to
>> be destroyed, by any method.
>
> And no object may be destroyed unless deallocated.

Well, if it's important that an allocated object not be destroyed, don't
allocate it from a storage pool that can go out of scope!

Re: Custom Storage Pool questions

<siuigp$bqs$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6029&group=comp.lang.ada#6029

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Tue, 28 Sep 2021 10:07:52 +0200
Organization: Aioe.org NNTP Server
Message-ID: <siuigp$bqs$1@gioia.aioe.org>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org>
<lywnnha7y1.fsf@pushface.org>
<1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com>
<c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com>
<si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org>
<si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net>
<si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net>
<si4ell$1b25$1@gioia.aioe.org> <sib8rc$nda$1@franka.jacob-sparre.dk>
<sibvcr$1ico$1@gioia.aioe.org> <siu5r7$st6$1@franka.jacob-sparre.dk>
<siueba$efk$1@gioia.aioe.org> <lymtnxb0hs.fsf@pushface.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="12124"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Tue, 28 Sep 2021 08:07 UTC

On 2021-09-28 09:52, Simon Wright wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

>> And no object may be destroyed unless deallocated.
>
> Well, if it's important that an allocated object not be destroyed, don't
> allocate it from a storage pool that can go out of scope!

That was never the case.

The case is that an object allocated in a pool gets finalized because
the access type (not the pool!) used to allocate the object goes out of
the scope.

This makes no sense whatsoever.

Again, finalization must be tied with [logical] deallocation. Just like
initialization is with allocation.

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

Re: Custom Storage Pool questions

<sj03gm$7j9$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6031&group=comp.lang.ada#6031

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Tue, 28 Sep 2021 17:04:05 -0500
Organization: JSA Research & Innovation
Lines: 34
Message-ID: <sj03gm$7j9$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org> <lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com> <c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net> <si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net> <si4ell$1b25$1@gioia.aioe.org> <sib8rc$nda$1@franka.jacob-sparre.dk> <sibvcr$1ico$1@gioia.aioe.org> <siu5r7$st6$1@franka.jacob-sparre.dk> <siueba$efk$1@gioia.aioe.org> <lymtnxb0hs.fsf@pushface.org> <siuigp$bqs$1@gioia.aioe.org>
Injection-Date: Tue, 28 Sep 2021 22:04:07 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="7785"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Tue, 28 Sep 2021 22:04 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:siuigp$bqs$1@gioia.aioe.org...
> On 2021-09-28 09:52, Simon Wright wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>
>>> And no object may be destroyed unless deallocated.
>>
>> Well, if it's important that an allocated object not be destroyed, don't
>> allocate it from a storage pool that can go out of scope!
>
> That was never the case.
>
> The case is that an object allocated in a pool gets finalized because the
> access type (not the pool!) used to allocate the object goes out of the
> scope.
>
> This makes no sense whatsoever.
>
> Again, finalization must be tied with [logical] deallocation. Just like
> initialization is with allocation.

But it is. All of the objects allocated from an access type are logically
deallocated when the access type goes out of scope (and the memory can be
recovered). Remember that Ada was designed so that one never needs to use
Unchecked_Deallocation.

I could see an unsafe language (like C) doing the sort of thing you suggest,
but not Ada. Every object in Ada has a specific declaration point,
initialization point, finalization point, and destruction point. There are
no exceptions.

Randy.

Re: Custom Storage Pool questions

<sj169c$1vkg$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6032&group=comp.lang.ada#6032

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Wed, 29 Sep 2021 09:57:32 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sj169c$1vkg$1@gioia.aioe.org>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org>
<lywnnha7y1.fsf@pushface.org>
<1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com>
<c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com>
<si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org>
<si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net>
<si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net>
<si4ell$1b25$1@gioia.aioe.org> <sib8rc$nda$1@franka.jacob-sparre.dk>
<sibvcr$1ico$1@gioia.aioe.org> <siu5r7$st6$1@franka.jacob-sparre.dk>
<siueba$efk$1@gioia.aioe.org> <lymtnxb0hs.fsf@pushface.org>
<siuigp$bqs$1@gioia.aioe.org> <sj03gm$7j9$1@franka.jacob-sparre.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="65168"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Wed, 29 Sep 2021 07:57 UTC

On 2021-09-29 00:04, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:siuigp$bqs$1@gioia.aioe.org...
>> On 2021-09-28 09:52, Simon Wright wrote:
>>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>>
>>>> And no object may be destroyed unless deallocated.
>>>
>>> Well, if it's important that an allocated object not be destroyed, don't
>>> allocate it from a storage pool that can go out of scope!
>>
>> That was never the case.
>>
>> The case is that an object allocated in a pool gets finalized because the
>> access type (not the pool!) used to allocate the object goes out of the
>> scope.
>>
>> This makes no sense whatsoever.
>>
>> Again, finalization must be tied with [logical] deallocation. Just like
>> initialization is with allocation.
>
> But it is. All of the objects allocated from an access type are logically
> deallocated when the access type goes out of scope (and the memory can be
> recovered).

Really? And where is the call to the pool's Deallocate in that case? You
cannot have it both ways.

> Remember that Ada was designed so that one never needs to use
> Unchecked_Deallocation.

Come on. There never existed Ada compiler with GC. And nobody could even
implement GC with the meaningless semantics of "collections" in the way,
killing objects at random. Either with GC or without it, there must be
no such thing as "collections."

> I could see an unsafe language (like C) doing the sort of thing you suggest,
> but not Ada.

How random finalizing user-allocated and user-freed objects is safe?

And I suggest doing exactly nothing as opposed to *unsafe*, costly and
meaningless behavior mandated by the standard now.

> Every object in Ada has a specific declaration point,
> initialization point, finalization point, and destruction point. There are
> no exceptions.

Yes, and how it that related to the issue?

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

Re: Custom Storage Pool questions

<bb237054-1f0c-4d31-bb61-4259ee3f21c8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6041&group=comp.lang.ada#6041

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:181d:: with SMTP id t29mr187307qtc.337.1632926512365;
Wed, 29 Sep 2021 07:41:52 -0700 (PDT)
X-Received: by 2002:a25:6106:: with SMTP id v6mr154961ybb.531.1632926511871;
Wed, 29 Sep 2021 07:41:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 29 Sep 2021 07:41:51 -0700 (PDT)
In-Reply-To: <sj169c$1vkg$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=146.5.2.231; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC
NNTP-Posting-Host: 146.5.2.231
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org>
<lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com>
<c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org>
<lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org>
<iqkevvFr27rU1@mid.individual.net> <si45ls$1goa$1@gioia.aioe.org>
<iqloa8F3sptU1@mid.individual.net> <si4ell$1b25$1@gioia.aioe.org>
<sib8rc$nda$1@franka.jacob-sparre.dk> <sibvcr$1ico$1@gioia.aioe.org>
<siu5r7$st6$1@franka.jacob-sparre.dk> <siueba$efk$1@gioia.aioe.org>
<lymtnxb0hs.fsf@pushface.org> <siuigp$bqs$1@gioia.aioe.org>
<sj03gm$7j9$1@franka.jacob-sparre.dk> <sj169c$1vkg$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bb237054-1f0c-4d31-bb61-4259ee3f21c8n@googlegroups.com>
Subject: Re: Custom Storage Pool questions
From: onewinge...@gmail.com (Shark8)
Injection-Date: Wed, 29 Sep 2021 14:41:52 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Shark8 - Wed, 29 Sep 2021 14:41 UTC

On Wednesday, September 29, 2021 at 1:57:35 AM UTC-6, Dmitry A. Kazakov wrote:
> Come on. There never existed Ada compiler with GC.
Untrue; GNAT for JVM, and GNAT for DOTNET.

> And nobody could even
> implement GC with the meaningless semantics of "collections" in the way,
> killing objects at random. Either with GC or without it, there must be
> no such thing as "collections."
How does this follow?
The 'element' type cannot go out of scope before the collection, and the collection going out of scope triggers its finalization/deallocation.

> > I could see an unsafe language (like C) doing the sort of thing you suggest,
> > but not Ada.
> How random finalizing user-allocated and user-freed objects is safe?
Finalization *isn't* random, it happens at well-defined places.
(And, IIRC, is idempotent; meaning that multiple calls have the same effect as a singular call.)

> And I suggest doing exactly nothing as opposed to *unsafe*, costly and
> meaningless behavior mandated by the standard now.
> > Every object in Ada has a specific declaration point,
> > initialization point, finalization point, and destruction point. There are
> > no exceptions.
> Yes, and how it that related to the issue?
Because these are the places that finalization (and deallocation/destruction) are defined to happen.

Re: Custom Storage Pool questions

<sj2008$1cmo$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6042&group=comp.lang.ada#6042

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Wed, 29 Sep 2021 17:16:25 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sj2008$1cmo$1@gioia.aioe.org>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org>
<lywnnha7y1.fsf@pushface.org>
<1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com>
<c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com>
<si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org>
<si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net>
<si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net>
<si4ell$1b25$1@gioia.aioe.org> <sib8rc$nda$1@franka.jacob-sparre.dk>
<sibvcr$1ico$1@gioia.aioe.org> <siu5r7$st6$1@franka.jacob-sparre.dk>
<siueba$efk$1@gioia.aioe.org> <lymtnxb0hs.fsf@pushface.org>
<siuigp$bqs$1@gioia.aioe.org> <sj03gm$7j9$1@franka.jacob-sparre.dk>
<sj169c$1vkg$1@gioia.aioe.org>
<bb237054-1f0c-4d31-bb61-4259ee3f21c8n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="45784"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Wed, 29 Sep 2021 15:16 UTC

On 2021-09-29 16:41, Shark8 wrote:
> On Wednesday, September 29, 2021 at 1:57:35 AM UTC-6, Dmitry A. Kazakov wrote:
>> Come on. There never existed Ada compiler with GC.
> Untrue; GNAT for JVM, and GNAT for DOTNET.

Neither is full Ada, AFAIK.

>> And nobody could even
>> implement GC with the meaningless semantics of "collections" in the way,
>> killing objects at random. Either with GC or without it, there must be
>> no such thing as "collections."
> How does this follow?

Because the rule disregards any object use. No collector, manual or
automatic can deal with that mess.

> Finalization *isn't* random, it happens at well-defined places.

Random = unrelated to the object's life time.

> (And, IIRC, is idempotent; meaning that multiple calls have the same effect as a singular call.)

Which is obviously not.

>> And I suggest doing exactly nothing as opposed to *unsafe*, costly and
>> meaningless behavior mandated by the standard now.
>>> Every object in Ada has a specific declaration point,
>>> initialization point, finalization point, and destruction point. There are
>>> no exceptions.
>> Yes, and how it that related to the issue?
> Because these are the places that finalization (and deallocation/destruction) are defined to happen.

So? How exactly any of this implies that the place of Finalization can
be in a place other than the place of deallocation?

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

Re: Custom Storage Pool questions

<sj2vk4$sj$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6048&group=comp.lang.ada#6048

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!paganini.bofh.team!newsfeed.xs3.de!callisto.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Wed, 29 Sep 2021 19:16:03 -0500
Organization: JSA Research & Innovation
Lines: 45
Message-ID: <sj2vk4$sj$1@franka.jacob-sparre.dk>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com> <ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org> <lywnnha7y1.fsf@pushface.org> <1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com> <c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com> <si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org> <si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net> <si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net> <si4ell$1b25$1@gioia.aioe.org> <sib8rc$nda$1@franka.jacob-sparre.dk> <sibvcr$1ico$1@gioia.aioe.org> <siu5r7$st6$1@franka.jacob-sparre.dk> <siueba$efk$1@gioia.aioe.org> <lymtnxb0hs.fsf@pushface.org> <siuigp$bqs$1@gioia.aioe.org> <sj03gm$7j9$1@franka.jacob-sparre.dk> <sj169c$1vkg$1@gioia.aioe.org> <bb237054-1f0c-4d31-bb61-4259ee3f21c8n@googlegroups.com> <sj2008$1cmo$1@gioia.aioe.org>
Injection-Date: Thu, 30 Sep 2021 00:16:04 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="915"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Thu, 30 Sep 2021 00:16 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:sj2008$1cmo$1@gioia.aioe.org...
....
> Random = unrelated to the object's life time.

All objects have to disappear before their type disappears, so the object
*cannot* live longer than the access type for which it is allocated from.
Any use of the object after that point is erroneous, so Finalization has to
happen before it as well.

It's probably a lousy idea to share pool objects (as opposed to pool types)
amongst access types. The pool object should have the same lifetime as the
access type (we require that for subpools specifically because finalization
doesn't make sense any other way). A similar rule should have been enforced
for all pools, but it would be incompatible (alas).

If you do have a longer lived pool and a shorter lived access type, you will
end up with a bunch of zombie objects in the pool that cannot be used in any
way (as any access is erroneous). All that can happen is a memory leak.
Don't do that.

....
>>> And I suggest doing exactly nothing as opposed to *unsafe*, costly and
>>> meaningless behavior mandated by the standard now.
>>>> Every object in Ada has a specific declaration point,
>>>> initialization point, finalization point, and destruction point. There
>>>> are
>>>> no exceptions.
>>> Yes, and how it that related to the issue?
>> Because these are the places that finalization (and
>> deallocation/destruction) are defined to happen.
>
> So? How exactly any of this implies that the place of Finalization can be
> in a place other than the place of deallocation?

Deallocation is at most a convinience in Ada; it isn't even required to do
anything. One never can assume anything is actually recovered, so it is not
a meaningful concept semantically.

OTOH, object destruction happens before the type goes away, and finalization
happens before that. That is the point here.

Randy.

Re: Custom Storage Pool questions

<sj3r92$pla$3@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6060&group=comp.lang.ada#6060

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Custom Storage Pool questions
Date: Thu, 30 Sep 2021 10:08:02 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sj3r92$pla$3@gioia.aioe.org>
References: <e3c5c553-4a7f-408a-aaa7-60ec0b70202dn@googlegroups.com>
<ly5yv1bxgy.fsf@pushface.org> <shtg99$tgd$1@gioia.aioe.org>
<lywnnha7y1.fsf@pushface.org>
<1d2551f4-8189-44ec-a54d-4a56a672bedcn@googlegroups.com>
<c2d59417-398f-42a0-ab4b-b4f947325be0n@googlegroups.com>
<si26q3$13l1$1@gioia.aioe.org> <lyo88r9e99.fsf@pushface.org>
<si2ud7$fv2$1@gioia.aioe.org> <iqkevvFr27rU1@mid.individual.net>
<si45ls$1goa$1@gioia.aioe.org> <iqloa8F3sptU1@mid.individual.net>
<si4ell$1b25$1@gioia.aioe.org> <sib8rc$nda$1@franka.jacob-sparre.dk>
<sibvcr$1ico$1@gioia.aioe.org> <siu5r7$st6$1@franka.jacob-sparre.dk>
<siueba$efk$1@gioia.aioe.org> <lymtnxb0hs.fsf@pushface.org>
<siuigp$bqs$1@gioia.aioe.org> <sj03gm$7j9$1@franka.jacob-sparre.dk>
<sj169c$1vkg$1@gioia.aioe.org>
<bb237054-1f0c-4d31-bb61-4259ee3f21c8n@googlegroups.com>
<sj2008$1cmo$1@gioia.aioe.org> <sj2vk4$sj$1@franka.jacob-sparre.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="26282"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Thu, 30 Sep 2021 08:08 UTC

On 2021-09-30 02:16, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:sj2008$1cmo$1@gioia.aioe.org...
> ...
>> Random = unrelated to the object's life time.
>
> All objects have to disappear before their type disappears, so the object
> *cannot* live longer than the access type for which it is allocated from.

The type of the access type /= the type of object. Only access objects
must disappear and they do.

> It's probably a lousy idea to share pool objects (as opposed to pool types)
> amongst access types.

You need these for access discriminants.

> If you do have a longer lived pool and a shorter lived access type, you will
> end up with a bunch of zombie objects in the pool that cannot be used in any
> way (as any access is erroneous). All that can happen is a memory leak.
> Don't do that.

Nope, this is exactly how it works with most specialized pools, like
arenas, stacks, reference counting pools etc.

>>>> And I suggest doing exactly nothing as opposed to *unsafe*, costly and
>>>> meaningless behavior mandated by the standard now.
>>>>> Every object in Ada has a specific declaration point,
>>>>> initialization point, finalization point, and destruction point. There
>>>>> are
>>>>> no exceptions.
>>>> Yes, and how it that related to the issue?
>>> Because these are the places that finalization (and
>>> deallocation/destruction) are defined to happen.
>>
>> So? How exactly any of this implies that the place of Finalization can be
>> in a place other than the place of deallocation?
>
> Deallocation is at most a convinience in Ada; it isn't even required to do
> anything.

So is Finialize.

> OTOH, object destruction happens before the type goes away, and finalization
> happens before that. That is the point here.

See above, these are different objects of different types. The actual
object type is alive and well (unless killed by some collection).

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

Pages:1234
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor