Skip to content

Commit

Permalink
Fixed handling of -XX:+UseMallocHooks on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
schmelter-sap committed Oct 1, 2023
1 parent 6552617 commit c4a95a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions src/java.base/macosx/native/libjli/java_md_macosx.m
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,7 @@ static void MacOSXStartup(int argc, char *argv[]) {
}

if (putenv(env_entry) == 0) {
char** new_args = (char**) JLI_MemAlloc(sizeof(char*) * (*pargc));

for (int i = 1; i < *pargc; ++i) {
new_args[i - 1] = (*pargv)[i];
}

new_args[*pargc - 1] = NULL;
execve((*pargv)[0], new_args, environ);
execv(execname, argv);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/java.base/share/native/libjli/java.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ jboolean ShouldPreloadLibMallocHooks(int argc, char **argv) {
#if defined(__APPLE__) || defined(LINUX)
jboolean uses_new_trace = JNI_FALSE;
jboolean uses_old_trace = JNI_FALSE;
#if defined(APPLE)
#if defined(__APPLE__)
char const* env_name = "DYLD_INSERT_LIBRARIES";
char const* libpath = "libmallochooks.dylib";
#else
Expand Down

0 comments on commit c4a95a9

Please sign in to comment.