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

MemoryLayout and 32-bit VMs: should long[]/double[] be 4-byte aligned?

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • None
    • core-libs
    • None

      See JDK-8255343 change. The test fails on x86_32, because the alignment by 8 is unexpected. It is an open question whether the alignment should indeed be 4 or 8 for those types.

      For one, this makes the implementation assumption that nothing accesses long[]/double[] elements atomically. This might have been okay in the past, but today we can probably do the atomic access with VarHandle, and it is supposed to work somehow.

      If we change JAVA_LONG and JAVA_DOUBLE alignment to 4 for x86_32, then JDK-8255343 can be reverted.

            Unassigned Unassigned
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: