From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Custom Storage Pool questions Date: Mon, 20 Sep 2021 18:58:34 -0500 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Mon, 20 Sep 2021 23:58:36 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="23334"; 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 Xref: reader02.eternal-september.org comp.lang.ada:62791 List-Id: "J-P. Rosen" wrote in message news:shpg9b$t23$1@dont-email.me... > Le 14/09/2021 à 08:23, Dmitry A. Kazakov a écrit : >> Of course, a proper solution would be fixing Ada by adding another >> address attribute: >> >> X'Object_Address >> >> returning the first address of the object as allocated. > But you cannot assume that the object is allocated as one big chunk. > Bounds can be allocated at a different place. What would be > X'Object_Address in that case? The address of the real object, which is the bounds. (I'm using "object" in the Janus/Ada compiler sense and not in the Ada sense.) The only way I could make sense of the implementation requirements for Janus/Ada was to have every object be statically sized. If the Ada object is *not* statically sized, then the Janus/Ada object is a descriptor that provides access to that Ada object data. Generally, one wants access to the statically sized object, as that provides access to everything else (there may be multiple levels if discriminant-dependent arrays are involved). That's not what 'Address is supposed to provide, so the address used internally to the compiler is the wrong answer in Ada terms, but it is the right answer for most uses (storage pools being an obvious example). When one specifies 'Address in Janus/Ada, you are specifying the address of the statically allocated data. The rest of the object lives in some storage pool and it makes absolutely no sense to try to force that somewhere. There's no sensible reason to expect 'Address to be implementation-independent; specifying the address of unconstrained arrays is nonsense unless you know that the same Ada compiler is creating the object you are accessing -- hardly a common case. Randy.