Skip to content

Commit

Permalink
Only support 64 bit platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
schmelter-sap committed Jul 8, 2024
1 parent c4545d9 commit 018192c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/os/posix/malloctrace/mallocTracePosix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
*/

#if defined(LINUX) || defined(__APPLE__)
#if defined(_LP64) && (defined(LINUX) || defined(__APPLE__))

#include "precompiled.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os/posix/malloctrace/mallocTracePosix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/runtime/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/services/diagnosticCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -96,7 +96,7 @@ void DCmdRegistrant::register_dcmds(){
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<TrimCLibcHeapDCmd>(full_export, true, false));
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<sap::MallocTraceDCmd>(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<sap::MallocTraceEnableDCmd>(full_export, true, false));
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<sap::MallocTraceDisableDCmd>(full_export, true, false));
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/utilities/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/utilities/vmError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 018192c

Please sign in to comment.