diff options
author | Martin Liska <mliska@suse.cz> | 2018-11-05 14:35:09 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-11-05 13:35:09 +0000 |
commit | 46aeb07ff8f75808f6a76af52e9d8d9647e3b935 (patch) | |
tree | ad74c440f03d8593e0e9156d1b4a175e5c4b9e7c /libcpp | |
parent | 6388cb295749b56bcdde22dec5bcd27007d31c4f (diff) | |
download | gcc-46aeb07ff8f75808f6a76af52e9d8d9647e3b935.zip gcc-46aeb07ff8f75808f6a76af52e9d8d9647e3b935.tar.gz gcc-46aeb07ff8f75808f6a76af52e9d8d9647e3b935.tar.bz2 |
Fix string pool statistics.
2018-11-05 Martin Liska <mliska@suse.cz>
* symtab.c (ht_dump_statistics): Make dump conditional
based on alloc_subobject.
From-SVN: r265797
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 5 | ||||
-rw-r--r-- | libcpp/symtab.c | 14 |
2 files changed, 15 insertions, 4 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index d9eaa04..36ee636 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,8 @@ +2018-11-05 Martin Liska <mliska@suse.cz> + + * symtab.c (ht_dump_statistics): Make dump conditional + based on alloc_subobject. + 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 diff --git a/libcpp/symtab.c b/libcpp/symtab.c index fd86c84..e6e5bcb 100644 --- a/libcpp/symtab.c +++ b/libcpp/symtab.c @@ -304,7 +304,6 @@ ht_dump_statistics (cpp_hash_table *table) while (++p < limit); nelts = table->nelements; - overhead = obstack_memory_used (&table->stack) - total_bytes; headers = table->nslots * sizeof (hashnode); fprintf (stderr, "\nString pool\nentries\t\t%lu\n", @@ -315,9 +314,16 @@ ht_dump_statistics (cpp_hash_table *table) (unsigned long) table->nslots); fprintf (stderr, "deleted\t\t%lu\n", (unsigned long) deleted); - fprintf (stderr, "bytes\t\t%lu%c (%lu%c overhead)\n", - SCALE (total_bytes), LABEL (total_bytes), - SCALE (overhead), LABEL (overhead)); + + if (table->alloc_subobject) + fprintf (stderr, "GGC bytes\t%lu%c\n", + SCALE (total_bytes), LABEL (total_bytes)); + else + { + overhead = obstack_memory_used (&table->stack) - total_bytes; + fprintf (stderr, "obstack bytes\t%lu%c (%lu%c overhead)\n", + SCALE (total_bytes), LABEL (total_bytes)); + } fprintf (stderr, "table size\t%lu%c\n", SCALE (headers), LABEL (headers)); |