RFR: 8247910: Improve alignment and power-of-2 utilities using C++14

Kim Barrett kim.barrett at oracle.com
Fri Sep 11 09:49:57 UTC 2020


> On Sep 11, 2020, at 5:16 AM, Thomas Schatzl <thomas.schatzl at oracle.com> wrote:
> 
> Hi,
> 
> On 11.09.20 10:50, Kim Barrett wrote:
>> Please review this change which updates the alignment and power-of-2
>> utilities (utilities/align.hpp and utilities/powerOfTwo.hpp) to use
>> C++14 features.
>> Where possible, the alignment functions are now constexpr.  This
>> eliminates the need for alternate macros that needed to be used in
>> constexpr contexts.
>> Use <type_traits> and <limits> rather than HotSpot workalikes.
>> We no longer need max_value<T>(), as the problematic platform for
>> std::numeric_limits<T>::max() was Solaris.
>> Testing: tier1
> 
> in utilities/align.hpp:63:
> 
> 62 constexpr T align_down(T size, A alignment) {
> 
> The comment mentions "lognot" twice, at least it took me a while to understand that it is an abbreviation for "logical not". Probably it's common in LISP context?. I still think it might be worth just typing it out for easier reading.

I thought that was widespread usage; I guess my roots are showing. I'll
expand it to logical_not (which is the name of the corresponding C++
function object class).

> If you think it's better to keep lognot, fine with me too, I'll mark this as reviewed.
> 
> Thanks,
>  Thomas

Thanks for reviewing.



More information about the hotspot-dev mailing list