comp.lang.ada
 help / color / mirror / Atom feed
From: Frank Piron <frank.piron@konad.de>
Subject: Re: gnatmem does not work (win2K)?
Date: Mon, 07 Jul 2003 08:06:36 +0100
Date: 2003-07-07T08:06:36+01:00	[thread overview]
Message-ID: <3F091BFC.1051E0E3@konad.de> (raw)
In-Reply-To: 3F0592CB.CD53C24D@konad.de

Hi,
Additionally i tried the example from
Gnat User's Guide:

------------------------------------------------------------
with Unchecked_Deallocation;
procedure Test_Gm is

   type T is array (1..1000) of Integer;
   type Ptr is access T;
   procedure Free is new Unchecked_Deallocation (T, Ptr);
   A : Ptr;

   procedure My_Alloc is
   begin
      A := new T;
   end My_Alloc;

   procedure My_DeAlloc is
      B : Ptr := A;
   begin
      Free (B);
   end My_DeAlloc;

begin
   My_Alloc;
   for I in 1 .. 5 loop
      for J in I .. 5 loop
         My_Alloc;
      end loop;
      My_Dealloc;
   end loop;
end;
------------------------------------------------------------
I compiled with debugging option -g and after that run
> gnatmem test_gm.exe
which results in the following output:
>
Global information
------------------
   Total number of allocations        :  17
   Total number of deallocations      :   0
   Final Water Mark (non freed mem)   :  62.52 Kilobytes
   High Water Mark                    :  62.52 Kilobytes

Releasing deallocated memory at :
--------------------------------
   test_gm.adb:17 test_gm.my_dealloc

Allocation Root # 1
-------------------
 Number of non freed allocations    :  16
 Final Water Mark (non freed mem)   :  62.50 Kilobytes
 High Water Mark                    :  62.50 Kilobytes
 Backtrace                          :
   test_gm.adb:11 test_gm.my_alloc

Allocation Root # 2
-------------------
 Number of non freed allocations    :   1
 Final Water Mark (non freed mem)   :  24 Bytes
 High Water Mark                    :  24 Bytes
 Backtrace                          :
   : system__machine_state_operations__allocate_machine_state
>

OS is win2k. Is this a known behaviour of gnatmem on win32
systems?

TIA, Frank



  reply	other threads:[~2003-07-07  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-04 14:44 gnatmem does not work (win2K)? Frank Piron
2003-07-07  7:06 ` Frank Piron [this message]
2003-07-07  8:44   ` 
replies disabled

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