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

Change layout API to work with bytes, not bits

XMLWordPrintable

      The MemoryLayout API uses bits to model the size of a region of memory. This design was inspired by the Minimal LDL calculus:

      https://cr.openjdk.org/~jrose/panama/minimal-ldl.html

      This calculus had the objective of unifying memory layouts with register layouts - for this reason bit sizes were chosen. In the FFM API, however, memory layouts are used primarily to describe regions of memory. Also, the FFM API has another API, namely MemorySegment, whose sizes are expressed in bytes (not bits), and that is something that would be hard to change, because we want to provide an easy upgrade path for clients currently using the ByteBuffer API (which uses byte-based absolute offsets).

      For these reasons, I think it is time to bring memory layout in sync with memory segment, so that their sizes are expressed in bytes.

            mcimadamore Maurizio Cimadamore
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: