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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • None
    • Affects Version/s: 20
    • Component/s: 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()
      ===

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

              Created:
              Updated:
              Resolved: