diff options
author | Jason Merrill <jason@redhat.com> | 2019-03-26 09:38:53 -0400 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-03-26 14:38:53 +0100 |
commit | a6f361669312430748d51e6435da8f0d5c4b34c4 (patch) | |
tree | da534f921edf26922a5dfe3db8bc95262bf3145e /gcc/hash-table.h | |
parent | 11767f80f0be06988b3b317ae0205ae9f79c190c (diff) | |
download | gcc-a6f361669312430748d51e6435da8f0d5c4b34c4.zip gcc-a6f361669312430748d51e6435da8f0d5c4b34c4.tar.gz gcc-a6f361669312430748d51e6435da8f0d5c4b34c4.tar.bz2 |
mem-stats.h (mem_alloc_description::unregister_descriptor): New method.
* mem-stats.h (mem_alloc_description::unregister_descriptor): New
method.
(mem_alloc_description::release_object_overhead): Fix comment typos.
* hash-table.h (hash_table::~hash_table): Call
release_instance_overhead only if m_entries is non-NULL, otherwise
call unregister_descriptor.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r269943
Diffstat (limited to 'gcc/hash-table.h')
-rw-r--r-- | gcc/hash-table.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/hash-table.h b/gcc/hash-table.h index e5bbe67..37e4b83 100644 --- a/gcc/hash-table.h +++ b/gcc/hash-table.h @@ -652,12 +652,13 @@ hash_table<Descriptor, Lazy, Allocator>::~hash_table () Allocator <value_type> ::data_free (m_entries); else ggc_free (m_entries); + if (m_gather_mem_stats) + hash_table_usage ().release_instance_overhead (this, + sizeof (value_type) + * m_size, true); } - - if (m_gather_mem_stats) - hash_table_usage ().release_instance_overhead (this, - sizeof (value_type) - * m_size, true); + else if (m_gather_mem_stats) + hash_table_usage ().unregister_descriptor (this); } /* This function returns an array of empty hash table elements. */ |