diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2024-10-30-18-16-10.gh-issue-126195.6ezBpr.rst b/Misc/NEWS.d/next/Core_and_Builtins/2024-10-30-18-16-10.gh-issue-126195.6ezBpr.rst index 45a79e9877fdf5..01424d8a545d78 100644 --- a/Misc/NEWS.d/next/Core_and_Builtins/2024-10-30-18-16-10.gh-issue-126195.6ezBpr.rst +++ b/Misc/NEWS.d/next/Core_and_Builtins/2024-10-30-18-16-10.gh-issue-126195.6ezBpr.rst @@ -1 +1 @@ -Improve JIT performance by 1.4% on macOS Apple Silicon. Patch by Diego Russo. +Improve JIT performance by 1.4% on macOS Apple Silicon by using platform-specific memory protection APIs. Patch by Diego Russo. diff --git a/Python/jit.c b/Python/jit.c index dbaef80049c0d6..12b487e215f2dd 100644 --- a/Python/jit.c +++ b/Python/jit.c @@ -109,9 +109,9 @@ mark_executable(unsigned char *memory, size_t size) #else int failed = 0; __builtin___clear_cache((char *)memory, (char *)memory + size); -# ifndef MAP_JIT +#ifndef MAP_JIT failed = mprotect(memory, size, PROT_EXEC | PROT_READ); -# endif +#endif #endif if (failed) { jit_error("unable to protect executable memory");