RFR: Fix unsigned comparison in plab.cpp
Zhengyu Gu
zgu at redhat.com
Fri May 18 12:26:00 UTC 2018
Good.
-Zhengyu
On 05/18/2018 08:23 AM, Aleksey Shipilev wrote:
> 32-bit builds started to fail with:
>
> /pool/buildbot/slaves/sobornost/shenandoah-jdkX/build/src/hotspot/share/gc/shared/plab.cpp:87:29:
> error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> assert(_hard_end - _top >= oopDesc::header_size() + Universe::heap()->oop_extra_words(),
> ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fix:
>
> diff -r 19704db7c2c2 src/hotspot/share/gc/shared/plab.cpp
> --- a/src/hotspot/share/gc/shared/plab.cpp Fri May 18 14:02:15 2018 +0200
> +++ b/src/hotspot/share/gc/shared/plab.cpp Fri May 18 14:19:41 2018 +0200
> @@ -84,7 +84,7 @@
> size_t PLAB::retire_internal() {
> size_t result = 0;
> if (_top < _hard_end) {
> - assert(_hard_end - _top >= oopDesc::header_size() + Universe::heap()->oop_extra_words(),
> + assert(pointer_delta(_hard_end, _top) >= (size_t)(oopDesc::header_size() +
> Universe::heap()->oop_extra_words()),
> "better have enough space left to fill with dummy");
> HeapWord* obj = Universe::heap()->tlab_post_allocation_setup(_top);
> CollectedHeap::fill_with_object(obj, _hard_end);
>
>
> Testing: x86_32, x86_64 builds
>
> Thanks,
> -Aleksey
>
More information about the shenandoah-dev
mailing list