From 676e8950179fc8510fd832ff9c9f3e125c1c9118 Mon Sep 17 00:00:00 2001 From: Ramki Ramakrishna Date: Mon, 22 Jan 2024 16:02:04 +0000 Subject: [PATCH] const-ed is_clear() method of AgeTable. --- src/hotspot/share/gc/shared/ageTable.cpp | 4 ++-- src/hotspot/share/gc/shared/ageTable.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/shared/ageTable.cpp b/src/hotspot/share/gc/shared/ageTable.cpp index 376aaa16391c6..34e4bb91887a0 100644 --- a/src/hotspot/share/gc/shared/ageTable.cpp +++ b/src/hotspot/share/gc/shared/ageTable.cpp @@ -72,8 +72,8 @@ void AgeTable::clear() { } #ifndef PRODUCT -bool AgeTable::is_clear() { - for (size_t* p = sizes; p < sizes + table_size; ++p) { +bool AgeTable::is_clear() const { + for (const size_t* p = sizes; p < sizes + table_size; ++p) { if (*p != 0) return false; } return true; diff --git a/src/hotspot/share/gc/shared/ageTable.hpp b/src/hotspot/share/gc/shared/ageTable.hpp index 20d444350858d..decade6ee8581 100644 --- a/src/hotspot/share/gc/shared/ageTable.hpp +++ b/src/hotspot/share/gc/shared/ageTable.hpp @@ -56,7 +56,7 @@ class AgeTable: public CHeapObj { #ifndef PRODUCT // check whether it's clear - bool is_clear(); + bool is_clear() const; #endif // !PRODUCT // add entry