(10) RFR: 8157709: NMT should use size_t version of Atomic::add

David Holmes david.holmes at oracle.com
Mon Feb 13 23:56:56 UTC 2017


Thanks Serguei!

David

On 14/02/2017 6:50 AM, serguei.spitsyn at oracle.com wrote:
> Hi David,
>
> This looks good to me.
>
>
> Thanks,
> Serguei
>
>
> On 2/12/17 17:46, David Holmes wrote:
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8157709
>>
>> webrev: http://cr.openjdk.java.net/~dholmes/8157709/webrev/
>>
>> NMT typdef'd MemoryCounterType to jlong on 64-bit and jint on 32-bit.
>> Really it should just be size_t and in fact the typedef is not needed
>> at all as it was only used for casting size_t's when invoking
>> Atomic::add. So MemoryCounterType is removed. Only glitch was that
>> using negation of an unsigned variable triggered a warning on Windows
>> which I have had to silence with a pragma. (As unknown pragma's must
>> be ignored I have not ifdef'd the pragma - doing so would also be a
>> problem as warning suppression only operates on the next line, so then
>> I'd have to push and pop the warning which would be really, really ugly.)
>>
>>
>> Also as a result of this change there is no longer any use of the
>> buggy Atomic::add(jlong) and as discussed here:
>>
>> http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-February/021620.html
>>
>>
>> it is simply removed.
>>
>> Testing: JPRT
>>          runtime/NMT
>>
>> Thanks,
>> David
>


More information about the hotspot-runtime-dev mailing list