Skip to content

Commit 4e1e671

Browse files
committed
fix: properly disable nativeaccel on unsupported platforms
Another worst mistake of my life
1 parent 8d038ad commit 4e1e671

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

c2me-opts-natives-math/src/main/java/com/ishland/c2me/opts/natives_math/ModuleEntryPoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class ModuleEntryPoint {
2727
boolean actuallyEnabled = false;
2828
if (configured) {
2929
try {
30-
actuallyEnabled = Class.forName("com.ishland.c2me.opts.natives_math.common.NativeLoader").getField("linker").get(null) != null;
30+
actuallyEnabled = Class.forName("com.ishland.c2me.opts.natives_math.common.NativeLoader").getField("lookup").get(null) != null;
3131
} catch (Throwable t) {
3232
t.printStackTrace();
3333
}

c2me-opts-natives-math/src/main/java/com/ishland/c2me/opts/natives_math/common/NativeLoader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ private static SymbolLookup load0(String libName) {
6262
// load from resources
6363
try (final InputStream in = NativeLoader.class.getClassLoader().getResourceAsStream(libName)) {
6464
if (in == null) {
65-
throw new IOException("Cannot find native library " + libName);
65+
LOGGER.warn("Cannot find native library {}, possibly unsupported platform for native acceleration", libName);
66+
return null;
6667
}
6768
final Path tempFile;
6869
if (Boolean.getBoolean("vectorizedgen.preserveNative")) {

0 commit comments

Comments
 (0)