From a6f361669312430748d51e6435da8f0d5c4b34c4 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 26 Mar 2019 09:38:53 -0400 Subject: 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 From-SVN: r269943 --- gcc/hash-table.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gcc/hash-table.h') 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::~hash_table () Allocator ::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. */ -- cgit v1.1