RFR: 8186838: Generalize Atomic::inc/dec with templates
Kim Barrett
kim.barrett at oracle.com
Mon Sep 18 11:29:13 UTC 2017
> On Sep 18, 2017, at 4:43 AM, Erik Österlund <erik.osterlund at oracle.com> wrote:
>
> Hi,
>
> After some off-list discussions I have made a new version with the following improvements:
>
> 1) Added some comments describing the constraints on the types passed in to inc/dec (integral or pointer, and pointers are scaled).
> 2) Removed inc_ptr/dec_ptr and all uses of it. None of these actually used pointers, only pointer sized integers. So I thought removing these overloads and the unnecessary confusion caused by them would make it easier to review this change.
> 3) Renamed the typedef in the body representing the addend to be called I instead of T to be consistent with the convention Kim introduced.
>
> Full webrev:
> http://cr.openjdk.java.net/~eosterlund/8186838/webrev.02/
>
> Incremental webrev:
> http://cr.openjdk.java.net/~eosterlund/8186838/webrev.01_02/
In the descriptions of inc and dec:
- "inc*()" => "inc()" and "dec*()" => "dec()”, as the _ptr variants are now gone.
- "size of the type of the pointer" might be more clear as "size of the pointed to type”, or perhaps “the pointee type”.
Otherwise, looks good. I don’t need another webrev for above comment changes.
More information about the hotspot-dev
mailing list