JDK 22 |
---|
22 b24Fixed |
CSR :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
The HotSpot JVM currently has feature for native calls that passes elements of a primitive array to a native function if it finds an entry point for that native function that is prefixed with JavaCritical_.[1] No JDK code currently uses this feature since it is not officially supported, but it may be used in some experimental and external code to improve performance. We would like to deprecate this feature, but recognize that this may be a useful optimization for performance of native calls. [2] A suggested Panama replacement could be code that adds a "pin" method to MemorySegment (see comment), or some other marker, that avoids the copy to native memory then calls the function as a trivial function, like: func_trivial = abi.downcallHandle(addr, mt, fd.withAttribute(FunctionDescriptor.TRIVIAL_ATTRIBUTE_NAME, true)); [1] https://stackoverflow.com/questions/48730135/how-to-get-javacritical-to-really-work-on-jni [2] https://bugs.openjdk.java.net/browse/JDK-8233343
|