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

The spec on the method MemorySegment::segmentOffset() should be corrected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • 20
    • core-libs
    • None

      The spec on the methods MemorySegment::long segmentOffset(MemorySegment other) states:
      ===
      The offset is relative to the base address of this segment and can be a negative or positive value. For instance, if both segments are native segments, the resulting offset can be computed as follows:
      other.baseAddress().toRawLongValue() - segment.baseAddress().toRawLongValue()
      ===
      The reference to the method baseAddress() is a leftover from old API. It should be changed to address().
      Expected assertion is:
      ===
      other.address().toRawLongValue() - segment.address().toRawLongValue()
      ===

            pminborg Per-Ake Minborg
            lkuskov Leonid Kuskov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: