comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <OneWingedShark@gmail.com>
Subject: Re: A simple question about the "new" allocator
Date: Tue, 12 Aug 2014 12:49:03 -0600
Date: 2014-08-12T12:49:03-06:00	[thread overview]
Message-ID: <DktGv.521654$Ro3.320929@fx13.iad> (raw)
In-Reply-To: <a93a7da9-e3cc-410f-a7dc-f81ea8c179e5@googlegroups.com>

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.


  reply	other threads:[~2014-08-12 18:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12  6:54 A simple question about the "new" allocator NiGHTS
2014-08-12  7:35 ` Dmitry A. Kazakov
2014-08-12 13:38   ` G.B.
2014-08-12 10:29 ` sbelmont700
2014-08-12 18:49   ` Shark8 [this message]
2014-08-12 19:10     ` Adam Beneschan
2014-08-12 21:53       ` Niklas Holsti
2014-08-12 22:34         ` Adam Beneschan
2014-08-12 23:14           ` sbelmont700
2014-08-12 23:41             ` Adam Beneschan
2014-08-13  7:36               ` Dmitry A. Kazakov
2014-08-13 15:04                 ` Adam Beneschan
2014-08-13 20:32           ` Niklas Holsti
2014-08-12 15:10 ` Adam Beneschan
2014-08-12 16:07 ` Jeffrey Carter
2014-08-12 19:58   ` Robert A Duff
2014-08-12 17:51 ` NiGHTS
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox