Skip to content

Commit 201bd68

Browse files
author
pradeep
committed
fix for calling info as the first call in program
Every other package class extends Array module, thus loading the jni library automatically. Since, Util package doesn't Array, System.loadLibrary has to be called here as well. This won't effect performance and only first call to load a given library will take effect and subsequent calls are ignored.
1 parent 122e171 commit 201bd68

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

com/arrayfire/Util.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
public class Util {
44

5+
static {
6+
System.loadLibrary("af_java");
7+
}
8+
9+
public native static void info();
10+
511
public static String toString(Array a, String delim) {
612
String ret_txt="";
713
try {
@@ -25,6 +31,4 @@ public static float[] toFloatArray(String text, String delim) {
2531
}
2632
return ret_ary;
2733
}
28-
29-
public native static void info();
3034
}

0 commit comments

Comments
 (0)