FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

JNI methods update by mkitti · Pull Request #118 · JuliaInterop/JavaCall.jl · GitHub

JNI methods update - #118

Merged
mkitti merged 20 commits into
masterfrom
adambrewster-jni-methods
May 5, 2020
Merged

JNI methods update#118
mkitti merged 20 commits into
masterfrom
adambrewster-jni-methods

Conversation

mkitti commented May 3, 2020

Copy link
Copy Markdown
Member

I updated #29 and untangled the modules.

There is now an independent JNI submodule within JavaCall that does not depend on JavaCall or any other module. JavaCall does depend on the JNI submodule.

Most of the ccall references can now be made by calling a generate Julia method in the JNI module. This also exposes more JNI function calls which will help future development.

The generator script has been updated, modified and documented

mkitti requested a review from aviks May 3, 2020 04:48

aviks left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good to me, thanks for taking this on!

Comment thread src/jvm.jl
ppjvm = Array{Ptr{JavaVM}}(undef, 1)
ppenv = Array{Ptr{JNIEnv}}(undef, 1)
vm_args = JavaVMInitArgs(JNI_VERSION_1_6, convert(Cint, length(opts)),
vm_args = JavaVMInitArgs(JNI.JNI_VERSION_1_8, convert(Cint, length(opts)),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What's our minimum JVM version with this? Should probably document it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This would go along with Java 8, although as far as I can tell there really is not a difference between 1_6 and 1_8 in terms of the JNI, so maybe we should revert this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is documented here: https://docs.oracle.com/javase/9/docs/specs/jni/functions.html

As you previously noted, this correspondence is missing here in the Java 8 notes:
https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html#GetVersion

Comment thread src/JNI.jl

include("jnienv.jl")

global jnifunc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

maybe we should make these globals Refs now? JavaCall started when that feature did not exist in Julia, but maybe its worth doing now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done with b50fc15

Comment thread src/JNI.jl Outdated

# === Below Generated by make_jni2.jl ===

#export GetVersion

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

maybe get rid of the commented exports in the generated code?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done with c041f1d

mkitti commented May 4, 2020

Copy link
Copy Markdown
Member Author

I am tempted to move some of the initialization code and related structs into the JNI module. We could also move some of the globals there as well and turn them in Ref. This could be done after this is merged in.

mkitti merged commit 66538df into master May 5, 2020
mkitti deleted the adambrewster-jni-methods branch March 21, 2022 06:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL