OSDN Git Service

2009-04-29 Arnaud Charlet <charlet@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-stausa.ads
index af53656..f42e374 100644 (file)
@@ -46,6 +46,27 @@ package System.Stack_Usage is
      (Value : System.Address) return Stack_Address
       renames System.Storage_Elements.To_Integer;
 
+   Task_Name_Length : constant := 32;
+   --  The maximum length of task name displayed.
+   --  ??? Consider merging this variable with Max_Task_Image_Length.
+
+   type Task_Result is record
+      Task_Name : String (1 .. Task_Name_Length);
+
+      Value : Natural;
+      --  Amount of the stack used; the value is calculated on the basis of
+      --  the mechanism used by GNAT to allocate it, and it is NOT a precise
+      --  value.
+
+      Variation : Natural;
+      --  Possible variation in the amount of used stack. The real stack usage
+      --  may vary in the range Value +/- Variation
+
+      Max_Size : Natural;
+   end record;
+
+   type Result_Array_Type is array (Positive range <>) of Task_Result;
+
    type Stack_Analyzer is private;
    --  Type of the stack analyzer tool. It is used to fill a portion of the
    --  stack with Pattern, and to compute the stack used after some execution.
@@ -206,7 +227,7 @@ package System.Stack_Usage is
    procedure Initialize_Analyzer
      (Analyzer         : in out Stack_Analyzer;
       Task_Name        : String;
-      Stack_Size       : Natural;
+      My_Stack_Size    : Natural;
       Max_Pattern_Size : Natural;
       Bottom           : Stack_Address;
       Pattern          : Interfaces.Unsigned_32 := 16#DEAD_BEEF#);
@@ -256,10 +277,6 @@ package System.Stack_Usage is
 
 private
 
-   Task_Name_Length : constant := 32;
-   --  The maximum length of task name displayed.
-   --  ??? Consider merging this variable with Max_Task_Image_Length.
-
    package Unsigned_32_Addr is
      new System.Address_To_Access_Conversions (Interfaces.Unsigned_32);
 
@@ -308,20 +325,6 @@ private
 
    Compute_Environment_Task  : Boolean;
 
-   type Task_Result is record
-      Task_Name : String (1 .. Task_Name_Length);
-
-      Min_Measure : Natural;
-      --  Minimum value for the measure
-
-      Max_Measure : Natural;
-      --  Maximum value for the measure, taking into account the actual size
-      --  of the pattern filled.
-
-      Max_Size : Natural;
-   end record;
-
-   type Result_Array_Type is array (Positive range <>) of Task_Result;
    type Result_Array_Ptr is access all Result_Array_Type;
 
    Result_Array : Result_Array_Ptr;