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

Rework is_aligned_ to avoid multiple evaluation of the size expression

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      gc
    • Resolved In Build:
      b21

      Description

      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"

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: