OSDN Git Service

* genautomata.c (make_automaton, NDFA_to_DFA):
[pf3gnuchains/gcc-fork.git] / gcc / ggc-page.c
index 7e40d04..bf18e3f 100644 (file)
@@ -187,7 +187,7 @@ static const size_t extra_order_size_table[] = {
   sizeof (struct tree_list),
   TREE_EXP_SIZE (2),
   RTL_SIZE (2),                        /* MEM, PLUS, etc.  */
-  RTL_SIZE (9),                /* INSN, CALL_INSN, JUMP_INSN */
+  RTL_SIZE (9),                        /* INSN */
 };
 
 /* The total number of orders.  */
@@ -401,13 +401,12 @@ static struct globals
      zero otherwise.  We allocate them all together, to enable a
      better runtime data access pattern.  */
   unsigned long **save_in_use;
-
 #ifdef GATHER_STATISTICS
   struct
   {
-    /* Total memory allocated with ggc_alloc */
+    /* Total memory allocated with ggc_alloc */
     unsigned long long total_allocated;
-    /* Total overhead for memory to be allocated with ggc_alloc */
+    /* Total overhead for memory to be allocated with ggc_alloc */
     unsigned long long total_overhead;
 
     /* Total allocations and overhead for sizes less than 32, 64 and 128.
@@ -423,6 +422,9 @@ static struct globals
     unsigned long long total_allocated_under128;
     unsigned long long total_overhead_under128;
   
+    /* The allocations for each of the allocation orders.  */
+    unsigned long long total_allocated_per_order[NUM_ORDERS];
+
     /* The overhead for each of the allocation orders.  */
     unsigned long long total_overhead_per_order[NUM_ORDERS];
   } stats;
@@ -1171,8 +1173,9 @@ ggc_alloc (size_t size)
 #ifdef GATHER_STATISTICS
   {
     G.stats.total_overhead += OBJECT_SIZE (order) - size;
-    G.stats.total_overhead_per_order[order] += OBJECT_SIZE (order) - size;
     G.stats.total_allocated += OBJECT_SIZE(order);
+    G.stats.total_overhead_per_order[order] += OBJECT_SIZE (order) - size;
+    G.stats.total_allocated_per_order[order] += OBJECT_SIZE (order);
 
     if (size <= 32){
       G.stats.total_overhead_under32 += OBJECT_SIZE (order) - size;
@@ -1844,6 +1847,8 @@ ggc_print_statistics (void)
 
   /* Collect some information about the various sizes of
      allocation.  */
+  fprintf (stderr,
+           "Memory still allocated at the end of the compilation process\n");
   fprintf (stderr, "%-5s %10s  %10s  %10s\n",
           "Size", "Allocated", "Used", "Overhead");
   for (i = 0; i < NUM_ORDERS; ++i)
@@ -1885,6 +1890,8 @@ ggc_print_statistics (void)
 
 #ifdef GATHER_STATISTICS  
   {
+    fprintf (stderr, "\nTotal allocations and overheads during the compilation process\n");
+
     fprintf (stderr, "Total Overhead:                        %10lld\n",
              G.stats.total_overhead);
     fprintf (stderr, "Total Allocated:                       %10lld\n",
@@ -1904,9 +1911,13 @@ ggc_print_statistics (void)
              G.stats.total_allocated_under128);
    
     for (i = 0; i < NUM_ORDERS; i++)
-      if (G.stats.total_overhead_per_order[i])
-        fprintf (stderr, "Total Overhead  page size %7d:     %10lld\n",
-                 OBJECT_SIZE (i), G.stats.total_overhead_per_order[i]);
+      if (G.stats.total_allocated_per_order[i])
+        {
+          fprintf (stderr, "Total Overhead  page size %7d:     %10lld\n",
+                   OBJECT_SIZE (i), G.stats.total_overhead_per_order[i]);
+          fprintf (stderr, "Total Allocated page size %7d:     %10lld\n",
+                   OBJECT_SIZE (i), G.stats.total_allocated_per_order[i]);
+        }
   }
 #endif
 }