< prev index next >

src/hotspot/share/gc/g1/g1Allocator.cpp

Print this page
rev 53824 : imported patch 8219096-merge-termination-stats-logging

@@ -319,20 +319,30 @@
       _direct_allocated[state] = 0;
     }
   }
 }
 
-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;
 G1ArchiveRegionMap G1ArchiveAllocator::_closed_archive_region_map;
 G1ArchiveRegionMap G1ArchiveAllocator::_open_archive_region_map;
< prev index next >