From 018192cede38d10cd3e24062b71102e587bab0d0 Mon Sep 17 00:00:00 2001 From: Ralf Schmelter Date: Mon, 8 Jul 2024 17:47:00 +0200 Subject: [PATCH] Only support 64 bit platforms --- src/hotspot/os/posix/malloctrace/mallocTracePosix.cpp | 2 +- src/hotspot/os/posix/malloctrace/mallocTracePosix.hpp | 2 +- src/hotspot/share/runtime/thread.cpp | 4 ++-- src/hotspot/share/services/diagnosticCommand.cpp | 4 ++-- src/hotspot/share/utilities/debug.cpp | 4 ++-- src/hotspot/share/utilities/vmError.cpp | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/hotspot/os/posix/malloctrace/mallocTracePosix.cpp b/src/hotspot/os/posix/malloctrace/mallocTracePosix.cpp index 86b7ca9cf12..d5fea9b662f 100644 --- a/src/hotspot/os/posix/malloctrace/mallocTracePosix.cpp +++ b/src/hotspot/os/posix/malloctrace/mallocTracePosix.cpp @@ -22,7 +22,7 @@ * */ -#if defined(LINUX) || defined(__APPLE__) +#if defined(_LP64) && (defined(LINUX) || defined(__APPLE__)) #include "precompiled.hpp" diff --git a/src/hotspot/os/posix/malloctrace/mallocTracePosix.hpp b/src/hotspot/os/posix/malloctrace/mallocTracePosix.hpp index 41710bde2cb..5b21c2c719a 100644 --- a/src/hotspot/os/posix/malloctrace/mallocTracePosix.hpp +++ b/src/hotspot/os/posix/malloctrace/mallocTracePosix.hpp @@ -28,7 +28,7 @@ #include "services/diagnosticCommand.hpp" #include "utilities/globalDefinitions.hpp" -#if defined(LINUX) || defined(__APPLE__) && defined(_LP64) +#if defined(_LP64) && (defined(LINUX) || defined(__APPLE__)) #define MALLOC_TRACE_AVAILABLE 1 diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index ca9ab09bd28..ce0b3b57a96 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -145,7 +145,7 @@ #include "vitals_linux_himemreport.hpp" #endif // SapMachine 2024-04-09: malloc statistic -#if defined(LINUX) || defined(__APPLE__) +#if defined(_LP64) && (defined(LINUX) || defined(__APPLE__)) #include "malloctrace/mallocTracePosix.hpp" #endif @@ -3865,7 +3865,7 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { JFR_ONLY(Jfr::on_create_vm_1();) // SapMachine 2024-04-18: Initialize malloc statistic -#if defined(LINUX) || defined(__APPLE__) +#if defined(_LP64) && (defined(LINUX) || defined(__APPLE__)) sap::MallocStatistic::initialize(); #else if (MallocTraceAtStartup || UseMallocHooks) { diff --git a/src/hotspot/share/services/diagnosticCommand.cpp b/src/hotspot/share/services/diagnosticCommand.cpp index 00121b4ae45..b809d0ba0d9 100644 --- a/src/hotspot/share/services/diagnosticCommand.cpp +++ b/src/hotspot/share/services/diagnosticCommand.cpp @@ -57,7 +57,7 @@ #endif // SapMachine 2023-08-15: malloc trace2 -#if defined(LINUX) || defined(__APPLE__) +#if defined(_LP64) && (defined(LINUX) || defined(__APPLE__)) #include "malloctrace/mallocTracePosix.hpp" #endif @@ -96,7 +96,7 @@ void DCmdRegistrant::register_dcmds(){ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); #endif -#if defined(LINUX) || defined(__APPLE__) +#if defined(_LP64) && (defined(LINUX) || defined(__APPLE__)) // SapMachine 2023-08-15: malloc trace2 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); diff --git a/src/hotspot/share/utilities/debug.cpp b/src/hotspot/share/utilities/debug.cpp index 667c33a8449..2d675336d4d 100644 --- a/src/hotspot/share/utilities/debug.cpp +++ b/src/hotspot/share/utilities/debug.cpp @@ -65,7 +65,7 @@ #include "runtime/globals.hpp" // SapMachine 2023-08-15: malloc trace -#if defined(LINUX) || defined(__APPLE__) +#if defined(_LP64) && (defined(LINUX) || defined(__APPLE__)) #include "malloctrace/mallocTracePosix.hpp" #endif @@ -283,7 +283,7 @@ void report_vm_out_of_memory(const char* file, int line, size_t size, if (Debugging) return; // SapMachine 2024-04-18: Check if we should to an emergency dump for the malloc trace. -#if defined(LINUX) || defined(__APPLE__) +#if defined(_LP64) && (defined(LINUX) || defined(__APPLE__)) if ((vm_err_type == OOM_MALLOC_ERROR) || (vm_err_type == OOM_MMAP_ERROR)) { sap::MallocStatistic::emergencyDump(); } diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index 2c1a278c3dd..6e7038311d8 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -68,7 +68,7 @@ #endif // SapMachine 2023-08-15: malloc trace -#if defined(LINUX) || defined(__APPLE__) +#if defined(_LP64) && (defined(LINUX) || defined(__APPLE__)) #include "malloctrace/mallocTracePosix.hpp" #endif @@ -1378,7 +1378,7 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt Thread* thread, address pc, void* siginfo, void* context, const char* filename, int lineno, size_t size) { -#if defined(LINUX) || defined(__APPLE__) +#if defined(_LP64) && (defined(LINUX) || defined(__APPLE__)) // SapMachine 2023-09-18: Make sure we don't track allocations anymore. sap::MallocStatistic::shutdown(); #endif