RFR: Actual size should be set to zero on allocation failure

Aleksey Shipilev shade at redhat.com
Fri Jul 13 12:40:44 UTC 2018


Small regression. This block was accidentally lost during the refactoring:

diff -r ad93b65f336a src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp        Fri Jul 13 10:09:59 2018 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp        Fri Jul 13 14:31:13 2018 +0200
@@ -787,7 +787,11 @@
 #endif
   ShenandoahAllocationRequest req = ShenandoahAllocationRequest::for_tlab(min_size, requested_size);
   HeapWord* res = allocate_memory(req);
-  *actual_size = req.actual_size();
+  if (res != NULL) {
+    *actual_size = req.actual_size();
+  } else {
+    *actual_size = 0;
+  }
   return res;
 }

-Aleksey



More information about the shenandoah-dev mailing list