Local and global references in JNI
Local and global references in JNI
In the previous article, I introduced creating object arrays in JNI. This article is the eleventh in the JNI series. It introduces how to call Java methods and static methods in Native code in JNI.
The outline of the series is as follows:
Introduction to JNIJNI basic typeJNI StringJNI arrayJNI instance vari ...
Posted by Nomaad on Tue, 23 Nov 2021 17:24:54 -0800
JNI references to Java objects
reference:
JNI learning notes - local and global references
JNI exposes the class instances and array types of the Java layer as opaque references. The code of the native layer will access this opaque reference through the functions provided by JNI. There are different kinds of references in JN ...
Posted by Yaak on Thu, 04 Nov 2021 06:59:18 -0700
C language knowledge commonly used by JNI
1, Pointers and arrays
1. Ordinary pointer
The pointer is the memory address where the variable is stored. It has a type, and the address has no type.
int main(int argc, char const* argv[]) {
//Define variables
int i = 90;
//Define pointer p and take address character for variable i
int *p = &i;
float fi = 0.8f;
...
Posted by davidp on Thu, 23 Sep 2021 06:30:30 -0700