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

Roman Kennke roman at kennke.org
Fri Jul 13 12:45:06 UTC 2018


Am 13.07.2018 um 14:40 schrieb Aleksey Shipilev:
> 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
> 
> 

Oops. Ok :-)

Roman



More information about the shenandoah-dev mailing list