Re: RFR: 8282515: More clean up on NativeLibraries just for JNI library use
On Wed, 2 Mar 2022 17:04:01 GMT, Mandy Chung wrote: > This patch further cleans up NativeLibraries just for JNI library use. > RawNativeLibraries implements its own native load and unload methods. In > addition, this also fixes the implementation of `RawNativeLibraries::load` > not to throw UnsatisfiedLinkError if a library cannot be loaded for any > reason but instead returns null. Thanks for the review. I also think this is better and cleaner separation. The duplicated native code is small and they just call `JVM_LoadLibrary` and `JVM_UnloadLibrary` that makes it very clear what this native method does. - PR: https://git.openjdk.java.net/jdk/pull/7661
Re: RFR: 8282515: More clean up on NativeLibraries just for JNI library use [v2]
> This patch further cleans up NativeLibraries just for JNI library use. > RawNativeLibraries implements its own native load and unload methods. In > addition, this also fixes the implementation of `RawNativeLibraries::load` > not to throw UnsatisfiedLinkError if a library cannot be loaded for any > reason but instead returns null. Mandy Chung has updated the pull request incrementally with one additional commit since the last revision: fix no newline at end of file - Changes: - all: https://git.openjdk.java.net/jdk/pull/7661/files - new: https://git.openjdk.java.net/jdk/pull/7661/files/eae60a40..cbdc39ed Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk=7661=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk=7661=00-01 Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/7661.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7661/head:pull/7661 PR: https://git.openjdk.java.net/jdk/pull/7661
Re: RFR: 8282515: More clean up on NativeLibraries just for JNI library use
On Wed, 2 Mar 2022 17:04:01 GMT, Mandy Chung wrote: > This patch further cleans up NativeLibraries just for JNI library use. > RawNativeLibraries implements its own native load and unload methods. In > addition, this also fixes the implementation of `RawNativeLibraries::load` > not to throw UnsatisfiedLinkError if a library cannot be loaded for any > reason but instead returns null. Looks good - thanks for cleaning up further. I think separating the library implementation makes a lot of sense. There's some duplication at the native level, but that's acceptable IMHO - and probably better than having a shared piece of logic that can work in two very different modes. src/java.base/share/native/libjava/RawNativeLibraries.c line 98: > 96: JVM_UnloadLibrary(handle); > 97: JNU_ReleaseStringPlatformChars(env, name, cname); > 98: } Watch out for the newline - Marked as reviewed by mcimadamore (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7661
RFR: 8282515: More clean up on NativeLibraries just for JNI library use
This patch further cleans up NativeLibraries just for JNI library use. RawNativeLibraries implements its own native load and unload methods. In addition, this also fixes the implementation of `RawNativeLibraries::load` not to throw UnsatisfiedLinkError if a library cannot be loaded for any reason but instead returns null. - Commit messages: - 8282515: More clean up on NativeLibraries just for JNI library use Changes: https://git.openjdk.java.net/jdk/pull/7661/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk=7661=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8282515 Stats: 275 lines in 6 files changed: 175 ins; 28 del; 72 mod Patch: https://git.openjdk.java.net/jdk/pull/7661.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7661/head:pull/7661 PR: https://git.openjdk.java.net/jdk/pull/7661