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

Usages of is_object_aligned with pointers are broken

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 9, 10
    • 10
    • hotspot
    • None
    • gc
    • b21

    Description

      is_object_aligned only works correctly for sizes measured in words.

      When a pointer is passed into:
      inline bool is_object_aligned(intptr_t addr) {
        return addr == align_object_size(addr);
      }

      inline intptr_t align_object_size(intptr_t size) {
        return align_size_up(size, MinObjAlignment);
      }

      the pointer is incorrectly interpreted as a word size and the alignment is checked against MinObjectAligment instead of MinObjectAlignmentInBytes.

      This was found while working on JDK-8178489.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: