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

Brian Burkhalter bpb at openjdk.java.net
Fri May 13 14:48:50 UTC 2022


On Fri, 13 May 2022 06:47:47 GMT, Jaikiran Pai <jpai 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();

Yeah I had thought of that as well but shined it on. I'll update before integrating.

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

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


More information about the nio-dev mailing list