From 95c8022958f84047cf26909239d8608eff4e35fb Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Mon, 11 Jul 2022 14:07:12 +0000 Subject: [PATCH] 8290046: NMT: Remove unused MallocSiteTable::reset() Reviewed-by: jiefu, zgu --- .../share/services/mallocSiteTable.cpp | 22 ------------------- .../share/services/mallocSiteTable.hpp | 4 ---- 2 files changed, 26 deletions(-) diff --git a/src/hotspot/share/services/mallocSiteTable.cpp b/src/hotspot/share/services/mallocSiteTable.cpp index 00671279c0d..a1b897cf2ba 100644 --- a/src/hotspot/share/services/mallocSiteTable.cpp +++ b/src/hotspot/share/services/mallocSiteTable.cpp @@ -178,28 +178,6 @@ MallocSiteHashtableEntry* MallocSiteTable::new_entry(const NativeCallStack& key, return ::new (p) MallocSiteHashtableEntry(key, flags); } -void MallocSiteTable::reset() { - for (int index = 0; index < table_size; index ++) { - MallocSiteHashtableEntry* head = _table[index]; - _table[index] = NULL; - delete_linked_list(head); - } - - _hash_entry_allocation_stack = NULL; - _hash_entry_allocation_site = NULL; -} - -void MallocSiteTable::delete_linked_list(MallocSiteHashtableEntry* head) { - MallocSiteHashtableEntry* p; - while (head != NULL) { - p = head; - head = (MallocSiteHashtableEntry*)head->next(); - if (p != hash_entry_allocation_site()) { - delete p; - } - } -} - bool MallocSiteTable::walk_malloc_site(MallocSiteWalker* walker) { assert(walker != NULL, "NuLL walker"); return walk(walker); diff --git a/src/hotspot/share/services/mallocSiteTable.hpp b/src/hotspot/share/services/mallocSiteTable.hpp index 219b8cb5b2e..6041c25fd92 100644 --- a/src/hotspot/share/services/mallocSiteTable.hpp +++ b/src/hotspot/share/services/mallocSiteTable.hpp @@ -174,10 +174,6 @@ class MallocSiteTable : AllStatic { private: static MallocSiteHashtableEntry* new_entry(const NativeCallStack& key, MEMFLAGS flags); - static void reset(); - - // Delete a bucket linked list - static void delete_linked_list(MallocSiteHashtableEntry* head); static MallocSite* lookup_or_add(const NativeCallStack& key, uint32_t* marker, MEMFLAGS flags); static MallocSite* malloc_site(uint32_t marker);