Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8183570

Rework is_aligned_ to avoid multiple evaluation of the size expression

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • 10
    • hotspot
    • None
    • gc
    • b21

      Kim suggests that we replace:
      #define is_aligned_(size, alignment) ((size) == (align_up_((size), (alignment))))

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

      to make the expression "simpler, faster, and avoid multiple evaluation of the size expression"

            stefank Stefan Karlsson
            stefank Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: