[foreign-abi] [Rev 01] RFR: 8237585: Dismantle ForeignUnsafe (foreign-abi part)

Jorn Vernee jvernee at openjdk.java.net
Tue Feb 25 17:18:23 UTC 2020


> Removes ForeignUnsafe, moves `getUnsafeBase` and `getUnsafeAccess` to `MemoryAddress`, and moves `ofNativeUnchecked` to `MemorySegment`.
> 
> I've added a warning about the safety of these methods to the javadoc.
> 
> Use of the methods is guarded by a check against a system property, `jdk.incubator.foreign.permitUnsafeInterop` for the first 2, and `jdk.incubator.foreign.permitUncheckedSegments` for the latter. This needs to be set to `true` when running an application, or otherwise the use of these methods results in an `IllegalAccessError` being thrown.
> 
> I've updated the test accordingly, and also remove the FASTPATH option from the SysV ABI implementation, since it was not actually being used, but still causing the tests to be run multiple times.

The pull request has been updated with 1 additional commit.

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

Added commits:
 - 03c71822: Review comments:

Changes:
  - all: https://git.openjdk.java.net/panama-foreign/pull/31/files
  - new: https://git.openjdk.java.net/panama-foreign/pull/31/files/5c58877a..03c71822

Webrevs:
 - full: https://webrevs.openjdk.java.net/panama-foreign/31/webrev.01
 - incr: https://webrevs.openjdk.java.net/panama-foreign/31/webrev.00-01

  Stats: 43 lines in 7 files changed: 15 ins; 8 del; 20 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/31.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/31/head:pull/31

PR: https://git.openjdk.java.net/panama-foreign/pull/31


More information about the panama-dev mailing list