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: g2news2.google.com!news3.google.com!feeder.news-service.com!news.k-dsl.de!news-zh.switch.ch!switch.ch!news.ip-plus.net!newsfeed.ip-plus.net!news.post.ch!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: put of access type Date: Thu, 20 Aug 2009 08:18:04 +0200 Organization: Swisscom IP+ (post doesn't reflect views of Swisscom) Message-ID: <4a8cea9c$1@news.post.ch> References: <8sho8596j3qnja38id9ipejk0opkcn5b5m@4ax.com> NNTP-Posting-Host: 194.41.146.1 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: atlas.ip-plus.net 1250749089 23972 194.41.146.1 (20 Aug 2009 06:18:09 GMT) X-Complaints-To: abuse@ip-plus.net NNTP-Posting-Date: Thu, 20 Aug 2009 06:18:09 +0000 (UTC) User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) In-Reply-To: X-Original-NNTP-Posting-Host: w04asc.pnet.ch X-Original-Trace: 20 Aug 2009 08:18:04 +0200, w04asc.pnet.ch Xref: g2news2.google.com comp.lang.ada:7895 Date: 2009-08-20T08:18:04+02:00 List-Id: 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: type Simple_Access is record Offset : Integer; end record; type Access_All (Pool_Access : Boolean) is record case Pool_Access is true => Pool : access Pool_Type; Offset : Integer; false => Address : System.Address; end case; end record; Since a simple access type always points into the pool only the Offset is needed. since an access all can point anywhere more info is needed. This is why I always advice against use of access all when not needed. Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com