--- old/src/hotspot/share/gc/g1/g1Allocator.cpp 2019-02-15 14:21:52.804849875 +0100 +++ new/src/hotspot/share/gc/g1/g1Allocator.cpp 2019-02-15 14:21:52.547841920 +0100 @@ -321,16 +321,26 @@ } } -void G1PLABAllocator::waste(size_t& wasted, size_t& undo_wasted) { - wasted = 0; - undo_wasted = 0; +size_t G1PLABAllocator::waste() const { + size_t result = 0; for (uint state = 0; state < InCSetState::Num; state++) { PLAB * const buf = _alloc_buffers[state]; if (buf != NULL) { - wasted += buf->waste(); - undo_wasted += buf->undo_waste(); + result += buf->waste(); } } + return result; +} + +size_t G1PLABAllocator::undo_waste() const { + size_t result = 0; + for (uint state = 0; state < InCSetState::Num; state++) { + PLAB * const buf = _alloc_buffers[state]; + if (buf != NULL) { + result += buf->undo_waste(); + } + } + return result; } bool G1ArchiveAllocator::_archive_check_enabled = false;