RFR: 8247910: Improve alignment and power-of-2 utilities using C++14
Thomas Schatzl
thomas.schatzl at oracle.com
Fri Sep 11 09:16:33 UTC 2020
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.
If you think it's better to keep lognot, fine with me too, I'll mark
this as reviewed.
Thanks,
Thomas
More information about the hotspot-dev
mailing list