[foreign-memaccess+abi] RFR: 8310820: Remove MemorySegment::segmentOffset

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Jun 23 18:30:37 UTC 2023


This method was added a long time ago, mostly to support the use case of "rebasing" a safe segment over the unsafe "everything" segment. We have other ways to express these use cases in the current API.

On top of that, this method can return negative offsets, which would then lead to failures when used with access APIs.

Finally, since we have unified memory segments with addresses, computing relative offset between segment is fairly easy (just subtract the segment addresses).

-------------

Commit messages:
 - Initial push

Changes: https://git.openjdk.org/panama-foreign/pull/841/files
 Webrev: https://webrevs.openjdk.org/?repo=panama-foreign&pr=841&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8310820
  Stats: 54 lines in 4 files changed: 8 ins; 42 del; 4 mod
  Patch: https://git.openjdk.org/panama-foreign/pull/841.diff
  Fetch: git fetch https://git.openjdk.org/panama-foreign.git pull/841/head:pull/841

PR: https://git.openjdk.org/panama-foreign/pull/841


More information about the panama-dev mailing list