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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.63.67 with SMTP id z43mr18141yhc.11.1407885256467; Tue, 12 Aug 2014 16:14:16 -0700 (PDT) X-Received: by 10.140.33.203 with SMTP id j69mr12463qgj.2.1407885256173; Tue, 12 Aug 2014 16:14:16 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!v10no6603262qac.1!news-out.google.com!j6ni43193qas.0!nntp.google.com!v10no6603260qac.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 12 Aug 2014 16:14:16 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 206.53.78.59 References: <4dba71e0-30c9-4e16-9edb-4e8b43acc2ab@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5c104779-8f67-44f2-96be-5ad2f627df2c@googlegroups.com> Subject: Re: A simple question about the "new" allocator From: sbelmont700@gmail.com Injection-Date: Tue, 12 Aug 2014 23:14:16 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2812 X-Received-Body-CRC: 1681942062 Xref: news.eternal-september.org comp.lang.ada:21698 Date: 2014-08-12T16:14:16-07:00 List-Id: On Tuesday, August 12, 2014 6:34:14 PM UTC-4, Adam Beneschan wrote: >=20 > However, if Storage_Size is specified for an access type, I think that th= e program does have to allocate a pool just for that type, and the storage = for the pool does get reclaimed when the block is left. (13.11(18)) The d= ifference is that when Storage_Size is specified, the expectation is that t= he program will allocate a contiguous block of memory of that size to be us= ed for allocations for that access type, and that storage block can simply = be reclaimed all at once. If Storage_Size is not specified, there won't be= any such contiguous block.=20 >=20 Since we are already lawyering up, is it not true that procedure main is=20 begin=20 loop=20 declare=20 Test : access Positive :=3D new Positive;=20 begin=20 null;=20 end;=20 end loop;=20 end main; is (advised to be) equivalent to this: procedure main is=20 begin=20 loop=20 declare p : Some_Default_Pool; type T is access Positive; for T'Storage_Pool use p; Test : T :=3D new Positive;=20 begin=20 null;=20 end;=20 end loop;=20 end main; based on 13.11~25.4/2 ("Otherwise, a default storage pool should be created= at the point where the anonymous access type is elaborated") and then cons= equently reclaimed when p goes out of scope? -sb