RFR: Fix compilation errors on Windows

Zhengyu Gu zgu at redhat.com
Tue Feb 27 13:44:47 UTC 2018



On 02/27/2018 04:10 AM, Aleksey Shipilev wrote:
> On 02/27/2018 03:48 AM, Zhengyu Gu wrote:
>> The patch fixes compilation errors of current shenandoah jdk repo.
>>
>> Webrev: http://cr.openjdk.java.net/~zgu/shenandoah/sh-jdk-build/webrev.00/
> 
> *) Not very sure this is the right thing to do:
> 
>     50     _next = *const_cast<ShenandoahStrDedupEntry* volatile*>(&next);
> 
> It seems to me that the "volatile" is not need in the original cast, so it is just:
> 
>    50     _next = static_cast<ShenandoahStrDedupEntry* volatile>(next);
It turns out that we do not need cast at all.
   _next = next;

will do.

> 
> ?
> 
> *) So the cast to (int) is needed for write_ref_array_pre, but not for write_ref_array?
> 
>   112   ((ShenandoahBarrierSet*) BarrierSet::barrier_set())->write_ref_array((HeapWord*) dst, length);

write_ref_array actually takes size_t.

   void write_ref_array(HeapWord* start, size_t count);

Updated Webrev: 
http://cr.openjdk.java.net/~zgu/shenandoah/sh-jdk-build/webrev.01/index.html


-Zhengyu


> 
> 
> Otherwise OK.
> 
> -Aleksey
> 


More information about the shenandoah-dev mailing list