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

Need spec clarification of j.l.foreign.*Layout

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 19
    • core-libs
    • None
    • behavioral
    • minimal
    • Most of the changes touched by this change are benign, in the sense that the spec changes remove exceptions that cannot occur. The change to MemoryLayout::equals is more substantial, although that's how the implementation was behaving anyway.
    • Java API
    • SE

      Summary

      The specification for the memory layout API contains some issues that have accumulated as a result of API changes over the various incubation steps.

      Problem

      More in-depth testing revealed the following issues in the MemoryLayout API javadoc:

      • the MemoryLayout::equals contract is partially incorrect, as it does not take into account ValueLayout::carrier

      • SequenceLayout::reshape and SequenceLayout::flatten refer to an erroneous condition that can no longer happen given some simplifications in the API (e.g now all the layouts have a definite size)

      • ValueLayout::arrayElementVarHandle throws UOE if the alignment constraints are incorrect - but the javadoc text is unclear, and refers to the LayoutPath API which does not matter here.

      Specification

      Javadoc: http://cr.openjdk.java.net/~mcimadamore/8289558/v1/javadoc/java.base/module-summary.html

      Specdiff: http://cr.openjdk.java.net/~mcimadamore/8289558/v1/specdiff_out/overview-summary.html

            mcimadamore Maurizio Cimadamore
            lkuskov Leonid Kuskov
            Alan Bateman, Jorn Vernee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: