Skip to content

Commit

Permalink
8261905: Move implementation of OopStorage num_dead related functions
Browse files Browse the repository at this point in the history
Reviewed-by: ayang, tschatzl
  • Loading branch information
Kim Barrett committed Feb 19, 2021
1 parent 78cde64 commit 7e78c77
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/hotspot/share/gc/shared/oopStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) &&
Expand Down

1 comment on commit 7e78c77

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.