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

Athijegannathan Sundararajan sundar at openjdk.java.net
Tue Feb 25 16:14:21 UTC 2020


On Tue, 25 Feb 2020 15:03:35 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> 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.

src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java line 31:

> 30: 
> 31: import jdk.internal.foreign.MemorySegmentImpl;
> 32: import jdk.internal.foreign.Utils;

Is this import used in this file?

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

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


More information about the panama-dev mailing list