Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JNI persistence, yes newbie



OK I'm trying to do some JNI (C). Go figure. Hoping to get back to something sensible like JNIDirect soon enough.
JNI may have an advantage here though. 
I have a int array with state information that I'd like to keep less visible or more obfuscated or hidden from the java side.
Should be a JNI advantage.
But in cutting this code over and it runs but my test results don't match expected all of a sudden I noticed the int array seems to reset to zeros. I'm assuming this is lack of persistence due to being a shared library. (OK, yes actually a dll, it's the _other_ platform as well). 
I've looked at the JNI reference stuff, local, global and weak global. I've looked a little bit at the C static modifier trying to remember or understand how it might be different from the java static modifier. Either included method local or in the same C file. But am actually crashing at the moment and nothing seems the answer so far? 
How should I make a persistent int array within the JNI code?

Mike Hall    mikehall at spacestar dot net
http://www.spacestar.net/users/mikehall
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.