-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bindings/blst.{hpp,swg}: shift memory management to JVM GC. #54
Conversation
e04f148
to
445a70d
Compare
Hey @dot-asm ! Java part looks good to me. Some comments:
arg1 = (blst::SecretKey *)JCALL(GetLongArrayElements, jarg1, 0);
delete arg1; which I think would definitely cause
|
No class has
Unfortunately I haven't found a way to suppress them [yet]. As you correctly point out, blstJNI.delete-s are not called from generated .java code, and application is not supposed to call blstJNI directly. This is considered tolerable [for now]. [I'll respond to 3rd bullet point separately.] |
Oh right, sorry! Probably opened older |
445a70d
to
f2c6230
Compare
So far Java interface was reliant on deprecated finalize() method to free memory allocated by blst. Now we use Java long[] as opaque storage for blst structures.
f2c6230
to
7d21d13
Compare
Fixed. |
It's committed now. Just in case, if you get "disaster" exception after |
I've created separate #57 to address this. |
So far Java interface was reliant on deprecated finalize() method to
free memory allocated by blst. Now we use Java long[] as opaque
storage for blst structures.
@Nashatyrev, @cemozerr, could you have a look at this? Not necessarily at C++ part, as main question is if auto-generated .java code is sensible. In other words, execute
bindings/java/run.me
and skim through newly createdbindings/java/*.java
. Please:-)