comp.lang.ada
 help / color / mirror / Atom feed
* dinamic object reclamation
@ 2001-09-19 14:27 Anisimkov
  2001-09-19 14:55 ` Ted Dennison
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Anisimkov @ 2001-09-19 14:27 UTC (permalink / raw)


I wrote the test program about it.
-----------------------------
with text_io; use text_io;
procedure alloc is

  dummy : character;

  procedure act (i : integer)
  is
      type block is array (1 .. 1024) of integer;
      type block_ptr is access all block;
      ptr : block_ptr;
  begin
      ptr := new block;
      ptr (ptr'LAst) := i;
      put (integer'image(I));
  end;

begin
  for i in 1..20000 loop
    act (i);
    get_immediate(dummy);
  end loop;
end;
--------------------
The question is:
Is memory allocated by
      ptr := new block;
have to be freed automatically after leaving of procedure act ?
Am I have to use Ada.Unchecked_Deallocation for free memory ?
I'm acking becouse there is a memory leak without Unchecked_Deallocation
when program compiled in the GNAT 3.13.
Is it bug or regular behavior ?







^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2001-09-20 13:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-19 14:27 dinamic object reclamation Anisimkov
2001-09-19 14:55 ` Ted Dennison
2001-09-19 17:44   ` Anisimkov
2001-09-19 17:15     ` Ted Dennison
2001-09-19 19:21       ` Anisimkov
2001-09-19 19:18         ` Ted Dennison
2001-09-19 19:51         ` Simon Wright
2001-09-19 15:02 ` David C. Hoos
2001-09-19 19:28   ` Anisimkov
2001-09-19 19:21     ` David C. Hoos
2001-09-19 21:47     ` Stephen Leake
2001-09-20  2:43 ` David Botton
2001-09-20  7:39   ` Larry Kilgallen
2001-09-20 13:21     ` Ted Dennison

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