comp.lang.ada
 help / color / mirror / Atom feed
Subject: Re: gnatmem does not work (win2K)?
Date: Mon, 07 Jul 2003 10:44:11 +0200
Date: 2003-07-07T10:44:11+02:00	[thread overview]
Message-ID: <3f09331a$1@epflnews.epfl.ch> (raw)
In-Reply-To: 3F091BFC.1051E0E3@konad.de

I tried it on Linux (Red Hat 7.3) and I get the same output as you 
(instead of the "correct" one from the User's Guide...)

I do not have ACT support. If you do, warn them about this issue.

Rodrigo

Frank Piron wrote:
> 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  8:44 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
2003-07-07  8:44   `  [this message]
replies disabled

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