[platform] CPU architecture detection: using shortcuts

GitOrigin-RevId: ebd7ddc9e25e911b41b3a537ebef72b5dce43dcd
This commit is contained in:
Roman Shevchenko
2020-12-29 14:06:54 +00:00
committed by intellij-monorepo-bot
parent 3bd1904623
commit 5ea63d85c7
3 changed files with 5 additions and 5 deletions
@@ -179,9 +179,9 @@ public final class MemoryAgentUtil {
}
public static boolean isPlatformSupported() {
return SystemInfo.isWindows && (CpuArch.CURRENT == CpuArch.X86_64 || CpuArch.CURRENT == CpuArch.X86) ||
SystemInfo.isMac && CpuArch.CURRENT == CpuArch.X86_64 ||
SystemInfo.isLinux && CpuArch.CURRENT == CpuArch.X86_64;
return SystemInfo.isWindows && (CpuArch.isIntel32() || CpuArch.isIntel64()) ||
SystemInfo.isMac && CpuArch.isIntel64() ||
SystemInfo.isLinux && CpuArch.isIntel64();
}
private static boolean isIbmJdk(@NotNull JavaParameters parameters) {
@@ -45,7 +45,7 @@ public final class IdeaWin32 {
}
private static boolean loadBundledLibrary() throws IOException {
String name = CpuArch.CURRENT == CpuArch.X86_64 ? "IdeaWin64" : "IdeaWin32";
String name = CpuArch.isIntel64() ? "IdeaWin64" : "IdeaWin32";
URL bundled = IdeaWin32.class.getResource(name + ".dll");
if (bundled == null) {
return false;
@@ -12,7 +12,7 @@ import java.util.Arrays;
public final class NativeLibraryLoader {
public static void loadPlatformLibrary(@NotNull String libName) {
String baseName = libName;
if (CpuArch.CURRENT == CpuArch.X86_64) {
if (CpuArch.isIntel64()) {
baseName = baseName.replace("32", "") + "64";
}