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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 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!post02.iad.highwinds-media.com!fx13.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:30.0) Gecko/20100101 Thunderbird/30.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: A simple question about the "new" allocator References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Tue, 12 Aug 2014 18:49:07 UTC Organization: TeraNews.com Date: Tue, 12 Aug 2014 12:49:03 -0600 X-Received-Bytes: 1404 X-Received-Body-CRC: 857821218 Xref: news.eternal-september.org comp.lang.ada:21688 Date: 2014-08-12T12:49:03-06:00 List-Id: On 12-Aug-14 04:29, sbelmont700@gmail.com wrote: > procedure main is > begin > loop > declare > Test : access Positive := new Positive; > begin > null; > end; > end loop; > end main; I /think/ you can do it with a type definition on the inner-block: declare Type Inner_Access is not null access positive; Test : Inner_Access := new Positive; begin null; end; The reason is that leaving the nested-block's scope should force the deallocation of all Inner_Access types if I'm remembering the RM correctly.