RFR: 8183544: Missing parentheses in is_size_aligned_ macro

Kim Barrett kim.barrett at oracle.com
Wed Jul 5 01:02:55 UTC 2017

> On Jul 4, 2017, at 10:24 AM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
> Hi all,
> Please review this trivial patch to add parentheses to the is_aligned_ macro (used to be named is_size_aligned_).
> http://cr.openjdk.java.net/~stefank/8183544/webrev.00/
> MikaelG found this issue while reviewing another patch.
> Thanks,
> StefanK

I'm confused by the existing definition.  Why isn't it

#define is_aligned_(size, alignment) (((size) & align_mask(alignment)) == 0)

That seems like it would be simpler, faster, and avoid multiple
evaluation of the size expression.

More information about the hotspot-dev mailing list