summaryrefslogtreecommitdiff
path: root/gcc/ggc-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ggc-common.c')
-rw-r--r--gcc/ggc-common.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index 2e94ca4a6ef..43ccc0b7402 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -894,12 +894,11 @@ struct ggc_usage: public mem_usage
/* Dump usage coupled to LOC location, where TOTAL is sum of all rows. */
inline void dump (mem_location *loc, ggc_usage &total) const
{
- char s[4096];
- sprintf (s, "%s:%i (%s)", loc->get_trimmed_filename (),
- loc->m_line, loc->m_function);
- s[48] = '\0';
+ char *location_string = loc->to_string ();
- dump (s, total);
+ dump (location_string, total);
+
+ free (location_string);
}
/* Dump footer. */