RFR: 8286671: (fc) Modify sun.nio.ch.FileChannelImpl.map0() to accept a FileDescriptor parameter

Jaikiran Pai jpai at openjdk.java.net
Fri May 13 06:50:50 UTC 2022


On Thu, 12 May 2022 23:34:35 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Add a `FileDescriptor` as the first parameter of `map0()` and remove from the corresponding native code the use of `fd_chan`.

src/java.base/unix/native/libnio/ch/FileChannelImpl.c line 54:

> 52: 
> 53: JNIEXPORT jlong JNICALL
> 54: Java_sun_nio_ch_FileChannelImpl_initIDs(JNIEnv *env, jclass clazz)

Hello Brian, now that this function doesn't initialize ids, should it instead be renamed to something else? Also the corresponding `initIDs` method on the Java side? And perhaps remove this comment from `FileChannelImpl.java`:


    // Caches fieldIDs
    private static native long initIDs();

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

PR: https://git.openjdk.java.net/jdk/pull/8689


More information about the nio-dev mailing list