diff options
author | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-03 09:33:32 +0000 |
---|---|---|
committer | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-03 09:33:32 +0000 |
commit | 7da284df4ba7b34dbc6f5cb1c570578ffd1d12a6 (patch) | |
tree | 125beb54d6d03f07b223139332359997e5d92a29 /gcc/ggc-common.c | |
parent | 0f8612248dd8d530095748d846a020f5a58477e7 (diff) | |
download | gcc-7da284df4ba7b34dbc6f5cb1c570578ffd1d12a6.tar.gz |
Port pool-allocator memory stats to a new infrastructure.
* alloc-pool.c (allocate_pool_descriptor): Remove.
(struct pool_output_info): Likewise.
(print_alloc_pool_statistics): Likewise.
(dump_alloc_pool_statistics): Likewise.
* alloc-pool.h (struct pool_usage): New struct.
(pool_allocator::initialize): Change usage of memory statistics
to a new interface.
(pool_allocator::release): Likewise.
(pool_allocator::allocate): Likewise.
(pool_allocator::remove): Likewise.
* mem-stats-traits.h (enum mem_alloc_origin): Add new enum value
for a pool allocator.
* mem-stats.h (struct mem_location): Add new ctor.
(struct mem_usage): Add counter for number of
instances.
(mem_alloc_description::register_descriptor): New overload of
* mem-stats.h (mem_location::to_string): New function.
* bitmap.h (struct bitmap_usage): Use this new function.
* ggc-common.c (struct ggc_usage): Likewise.
the function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224070 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ggc-common.c')
-rw-r--r-- | gcc/ggc-common.c | 9 |
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. */ |