From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,9506bdc34331969a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: put of access type Date: Thu, 20 Aug 2009 19:18:37 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <8sho8596j3qnja38id9ipejk0opkcn5b5m@4ax.com> <4a8cea9c$1@news.post.ch> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1250813988 28014 69.95.181.76 (21 Aug 2009 00:19:48 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 21 Aug 2009 00:19:48 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news1.google.com comp.lang.ada:6956 Date: 2009-08-20T19:18:37-05:00 List-Id: "Martin Krischik" wrote in message news:4a8cea9c$1@news.post.ch... > Randy Brukardt schrieb: >> "Adam Beneschan" wrote in message >> news:c9aec6d6-4e9b-4bf6-9586-68a237175c9d@i18g2000pro.googlegroups.com... >> ... >>> Also, there's no rule saying that an access value has to be an address >>> at all. It's certainly conceivable that an access value may be >>> implemented as a reference to some storage pool and an offset into >>> that pool, allowing for the possibility that the memory management >>> system may just decide to pick up the whole pool and move it to some >>> other address, without making any of the access values invalid. >> >> I think the Ada 95 definition of storage pools would make this >> implementation hard to make work. (Which is unfortunate, it would have >> worked fine in Ada 83). > > It still works: I think you missed my point. The definition of the Allocate function for a storage pool returns an System.Address. Moreover, there is no notification when the access value returned from Allocate is dereferenced or converted to another access type. So if Allocate returns an offset rather than an address, the compiler generated code to implement .all and to implement conversions to anonymous access type is not going to take that into account -- it will think it received a System.Address. So this cannot work for any user-defined storage pool. A compiler *could* implement something like this for the default storage pool. But that is exactly the case when you need a general implementation, so it seems rather pointless. But you can't do this with a user-defined storage pool. (I suppose a compiler could provide its own magic storage pool with these semantics, but it is unlikely to be worth the effort.) Randy.