Skip to content

Commit

Permalink
8320054: Remove unused _count from NMT walker classes
Browse files Browse the repository at this point in the history
Reviewed-by: jsjolen, gziemski
  • Loading branch information
tstuefe committed Nov 15, 2023
1 parent e7486e8 commit 70f0c01
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/hotspot/share/nmt/memBaseline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,10 @@ int compare_virtual_memory_site(const VirtualMemoryAllocationSite& s1,
class MallocAllocationSiteWalker : public MallocSiteWalker {
private:
SortedLinkedList<MallocSite, compare_malloc_size> _malloc_sites;
size_t _count;

// Entries in MallocSiteTable with size = 0 and count = 0,
// when the malloc site is not longer there.
public:
MallocAllocationSiteWalker() : _count(0) { }

inline size_t count() const { return _count; }

LinkedList<MallocSite>* malloc_sites() {
return &_malloc_sites;
Expand All @@ -98,7 +94,6 @@ class MallocAllocationSiteWalker : public MallocSiteWalker {
bool do_malloc_site(const MallocSite* site) {
if (site->size() > 0) {
if (_malloc_sites.add(*site) != nullptr) {
_count++;
return true;
} else {
return false; // OOM
Expand All @@ -116,22 +111,17 @@ class VirtualMemoryAllocationWalker : public VirtualMemoryWalker {
typedef LinkedListImpl<ReservedMemoryRegion, AnyObj::C_HEAP, mtNMT,
AllocFailStrategy::RETURN_NULL> EntryList;
EntryList _virtual_memory_regions;
size_t _count;
DEBUG_ONLY(address _last_base;)
public:
VirtualMemoryAllocationWalker() :
_count(0)
#ifdef ASSERT
, _last_base(nullptr)
#endif
{}
VirtualMemoryAllocationWalker() {
DEBUG_ONLY(_last_base = nullptr);
}

bool do_allocation_site(const ReservedMemoryRegion* rgn) {
assert(rgn->base() >= _last_base, "region unordered?");
DEBUG_ONLY(_last_base = rgn->base());
if (rgn->size() > 0) {
if (_virtual_memory_regions.add(*rgn) != nullptr) {
_count ++;
return true;
} else {
return false;
Expand Down

0 comments on commit 70f0c01

Please sign in to comment.