Skip to content

Commit eeee528

Browse files
committed
GNATCOLL.Memory: Improve documentation of the Stack_Trace_Depth parameter
Setting this parameter to zero when calling the Configure procedure has the effect of disabling completely the tracking of the biggest memory users, which wasn't clear from the current documentation. So this patch enhances the documentation of both the Configure procedure as well as the Dump procedure to make that explicit. Change-Id: Ib8c4733b9e821779cf52e5bfc892969fddea44b5 TN: V302-002
1 parent 0c4499f commit eeee528

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/gnatcoll-memory.ads

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- G N A T C O L L --
33
-- --
4-
-- Copyright (C) 2005-2019, AdaCore --
4+
-- Copyright (C) 2005-2022, AdaCore --
55
-- --
66
-- This library is free software; you can redistribute it and/or modify it --
77
-- under terms of the GNU General Public License as published by the Free --
@@ -141,7 +141,8 @@ package GNATCOLL.Memory is
141141
-- traces that are output to indicate locations of actions for error
142142
-- conditions such as bad allocations. If set to zero, the debug pool
143143
-- will not try to compute backtraces. This is more efficient but gives
144-
-- less information on problem locations
144+
-- less information on problem locations (and in particular, this
145+
-- disables the tracking of the biggest users of memory).
145146
--
146147
-- Maximum_Logically_Freed_Memory: maximum amount of memory (bytes)
147148
-- that should be kept before starting to physically deallocate some.
@@ -199,8 +200,12 @@ package GNATCOLL.Memory is
199200

200201
procedure Dump (Size : Positive; Report : Report_Type := All_Reports);
201202
-- Dump information about memory usage.
202-
-- Size is the number of the biggest memory users we want to show. Report
203-
-- indicates which sorting order is used in the report
203+
-- Size is the number of the biggest memory users we want to show
204+
-- (requires that the Debug_Pool has been configured with Stack_Trace_Depth
205+
-- greater than zero). Also, for efficiency reasons, tracebacks with
206+
-- a memory allocation below 1_000 bytes are not shown in the "biggest
207+
-- memory users" part of the report.
208+
-- Report indicates which sorting order is used in the report.
204209

205210
procedure Reset;
206211
-- Reset all internal data. This is in general not needed, unless you want

0 commit comments

Comments
 (0)