diff options
Diffstat (limited to 'gcc/ggc-common.c')
-rw-r--r-- | gcc/ggc-common.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index 3ff64ffdd7d..6a997238629 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -845,8 +845,6 @@ init_ggc_heuristics (void) #endif } -#ifdef GATHER_STATISTICS - /* Datastructure used to store per-call-site statistics. */ struct loc_descriptor { @@ -1040,16 +1038,18 @@ add_statistics (void **slot, void *b) } /* Dump per-site memory statistics. */ -#endif + void -dump_ggc_loc_statistics (bool final ATTRIBUTE_UNUSED) +dump_ggc_loc_statistics (bool final) { -#ifdef GATHER_STATISTICS int nentries = 0; char s[4096]; size_t collected = 0, freed = 0, allocated = 0, overhead = 0, times = 0; int i; + if (! GATHER_STATISTICS) + return; + ggc_force_collect = true; ggc_collect (); @@ -1102,5 +1102,4 @@ dump_ggc_loc_statistics (bool final ATTRIBUTE_UNUSED) "source location", "Garbage", "Freed", "Leak", "Overhead", "Times"); fprintf (stderr, "-------------------------------------------------------\n"); ggc_force_collect = false; -#endif } |