Skip to content
Permalink
Browse files
8261905: Move implementation of OopStorage num_dead related functions
Reviewed-by: ayang, tschatzl
  • Loading branch information
Kim Barrett committed Feb 19, 2021
1 parent 78cde64 commit 7e78c777134399a6fd8dc3d7f3cc2b59129ce788
Showing with 15 additions and 15 deletions.
  1. +15 −15 src/hotspot/share/gc/shared/oopStorage.cpp
@@ -787,6 +787,21 @@ OopStorage::~OopStorage() {
os::free(const_cast<char*>(_name));
}

void OopStorage::register_num_dead_callback(NumDeadCallback f) {
assert(_num_dead_callback == NULL, "Only one callback function supported");
_num_dead_callback = f;
}

void OopStorage::report_num_dead(size_t num_dead) const {
if (_num_dead_callback != NULL) {
_num_dead_callback(num_dead);
}
}

bool OopStorage::should_report_num_dead() const {
return _num_dead_callback != NULL;
}

// Managing service thread notifications.
//
// We don't want cleanup work to linger indefinitely, but we also don't want
@@ -815,21 +830,6 @@ static jlong cleanup_trigger_permit_time = 0;
// too frequent.
const jlong cleanup_trigger_defer_period = 500 * NANOSECS_PER_MILLISEC;

void OopStorage::register_num_dead_callback(NumDeadCallback f) {
assert(_num_dead_callback == NULL, "Only one callback function supported");
_num_dead_callback = f;
}

void OopStorage::report_num_dead(size_t num_dead) const {
if (_num_dead_callback != NULL) {
_num_dead_callback(num_dead);
}
}

bool OopStorage::should_report_num_dead() const {
return _num_dead_callback != NULL;
}

void OopStorage::trigger_cleanup_if_needed() {
MonitorLocker ml(Service_lock, Monitor::_no_safepoint_check_flag);
if (Atomic::load(&needs_cleanup_requested) &&

1 comment on commit 7e78c77

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 7e78c77 Feb 19, 2021

Please sign in to comment.