diff options
Diffstat (limited to 'gcc/ada/g-debpoo.adb')
-rw-r--r-- | gcc/ada/g-debpoo.adb | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/gcc/ada/g-debpoo.adb b/gcc/ada/g-debpoo.adb index f7d3c2d..89de4d6 100644 --- a/gcc/ada/g-debpoo.adb +++ b/gcc/ada/g-debpoo.adb @@ -1921,21 +1921,27 @@ package body GNAT.Debug_Pools is begin Put_Line (""); + case Sort is - when Memory_Usage | All_Reports => + when All_Reports + | Memory_Usage + => Put_Line (Size'Img & " biggest memory users at this time:"); Put_Line ("Results include bytes and chunks still allocated"); Grand_Total := Float (Pool.Current_Water_Mark); + when Allocations_Count => Put_Line (Size'Img & " biggest number of live allocations:"); Put_Line ("Results include bytes and chunks still allocated"); Grand_Total := Float (Pool.Current_Water_Mark); + when Sort_Total_Allocs => Put_Line (Size'Img & " biggest number of allocations:"); Put_Line ("Results include total bytes and chunks allocated,"); Put_Line ("even if no longer allocated - Deallocations are" & " ignored"); Grand_Total := Float (Pool.Allocated); + when Marked_Blocks => Put_Line ("Special blocks marked by Mark_Traceback"); Grand_Total := 0.0; @@ -1964,16 +1970,22 @@ package body GNAT.Debug_Pools is Bigger := Max (M) = null; if not Bigger then case Sort is - when Memory_Usage | All_Reports => - Bigger := - Max (M).Total - Max (M).Total_Frees < - Elem.Total - Elem.Total_Frees; - when Allocations_Count => - Bigger := - Max (M).Count - Max (M).Frees - < Elem.Count - Elem.Frees; - when Sort_Total_Allocs | Marked_Blocks => - Bigger := Max (M).Count < Elem.Count; + when All_Reports + | Memory_Usage + => + Bigger := + Max (M).Total - Max (M).Total_Frees + < Elem.Total - Elem.Total_Frees; + + when Allocations_Count => + Bigger := + Max (M).Count - Max (M).Frees + < Elem.Count - Elem.Frees; + + when Marked_Blocks + | Sort_Total_Allocs + => + Bigger := Max (M).Count < Elem.Count; end case; end if; @@ -2001,10 +2013,15 @@ package body GNAT.Debug_Pools is P : Percent; begin case Sort is - when Memory_Usage | Allocations_Count | All_Reports => + when All_Reports + | Allocations_Count + | Memory_Usage + => Total := Max (M).Total - Max (M).Total_Frees; + when Sort_Total_Allocs => Total := Max (M).Total; + when Marked_Blocks => Total := Byte_Count (Max (M).Count); end case; @@ -2056,7 +2073,6 @@ package body GNAT.Debug_Pools is when others => Do_Report (Report); end case; - end Dump; ----------------- @@ -2068,7 +2084,6 @@ package body GNAT.Debug_Pools is Size : Positive; Report : Report_Type := All_Reports) is - procedure Internal is new Dump (Put_Line => Stdout_Put_Line, Put => Stdout_Put); |