RFR (XS): [9+8u] Signness mismatches comparing size_t with jint

Zhengyu Gu zgu at redhat.com
Wed Apr 19 14:45:25 UTC 2017


Look good.

Thanks,

-Zhengyu

On 04/19/2017 10:28 AM, Aleksey Shipilev wrote:
> Hi,
>
> This affects fastdebug compilation for 9 and 8u:
>
> diff -r 2a677339ac35 src/share/vm/gc/shenandoah/shenandoahHeapRegion.hpp
> --- a/src/share/vm/gc/shenandoah/shenandoahHeapRegion.hpp	Wed Apr 19 09:20:21
> 2017 +0200
> +++ b/src/share/vm/gc/shenandoah/shenandoahHeapRegion.hpp	Wed Apr 19 16:27:24
> 2017 +0200
> @@ -71,13 +71,13 @@
>
>    // Convert to jint with sanity checking
>    inline static jint region_size_bytes_jint() {
> -    assert (ShenandoahHeapRegion::RegionSizeBytes <= max_jint, "sanity");
> +    assert (ShenandoahHeapRegion::RegionSizeBytes <= (size_t)max_jint, "sanity");
>      return (jint)ShenandoahHeapRegion::RegionSizeBytes;
>    }
>
>    // Convert to jint with sanity checking
>    inline static jint region_size_shift_jint() {
> -    assert (ShenandoahHeapRegion::RegionSizeShift <= max_jint, "sanity");
> +    assert (ShenandoahHeapRegion::RegionSizeShift <= (size_t)max_jint, "sanity");
>      return (jint)ShenandoahHeapRegion::RegionSizeShift;
>    }
>
> diff -r 2a677339ac35 src/share/vm/gc/shenandoah/shenandoahHeapRegion.inline.hpp
> --- a/src/share/vm/gc/shenandoah/shenandoahHeapRegion.inline.hpp	Wed Apr 19
> 09:20:21 2017 +0200
> +++ b/src/share/vm/gc/shenandoah/shenandoahHeapRegion.inline.hpp	Wed Apr 19
> 16:27:24 2017 +0200
> @@ -43,7 +43,7 @@
>  }
>
>  inline void ShenandoahHeapRegion::increase_live_data_words(size_t s) {
> -  assert (s <= max_jint, "sanity");
> +  assert (s <= (size_t)max_jint, "sanity");
>    increase_live_data_words((jint)s);
>  }
>
> Testing: hotspot_gc_shenandoah
>
> Thanks,
> -Aleksey
>


More information about the shenandoah-dev mailing list