src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp
changeset 49945 9425445633cf
parent 48402 945332d45710
child 53244 9807daeb47c4
--- a/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp	Wed May 02 02:36:17 2018 -0700
+++ b/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp	Wed May 02 13:44:46 2018 +0200
@@ -36,6 +36,10 @@
   } while (0)
 
 
+inline void G1AllocRegion::reset_alloc_region() {
+  _alloc_region = _dummy_region;
+}
+
 inline HeapWord* G1AllocRegion::allocate(HeapRegion* alloc_region,
                                          size_t word_size) {
   assert(alloc_region != NULL, "pre-condition");
@@ -126,4 +130,17 @@
   return NULL;
 }
 
+inline HeapWord* MutatorAllocRegion::attempt_retained_allocation(size_t min_word_size,
+                                                                 size_t desired_word_size,
+                                                                 size_t* actual_word_size) {
+  if (_retained_alloc_region != NULL) {
+    HeapWord* result = par_allocate(_retained_alloc_region, min_word_size, desired_word_size, actual_word_size);
+    if (result != NULL) {
+      trace("alloc retained", min_word_size, desired_word_size, *actual_word_size, result);
+      return result;
+    }
+  }
+  return NULL;
+}
+
 #endif // SHARE_VM_GC_G1_G1ALLOCREGION_INLINE_HPP