Skip to content

Commit

Permalink
Always enable pthread
Browse files Browse the repository at this point in the history
  • Loading branch information
diegorusso committed Oct 18, 2024
1 parent 4bd1c70 commit 0b7fce8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Python/jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ jit_alloc(size_t size)
#elif defined(__APPLE__)
int flags = MAP_ANONYMOUS | MAP_PRIVATE;
int prot = PROT_READ | PROT_WRITE;
if (pthread_jit_write_protect_supported_np()) {
//if (pthread_jit_write_protect_supported_np()) {
if (1) {
flags |= MAP_JIT;
prot |= PROT_EXEC;
}
Expand Down Expand Up @@ -117,7 +118,8 @@ mark_executable(unsigned char *memory, size_t size)
#elif defined(__APPLE__)
int failed = 0;
__builtin___clear_cache((char *)memory, (char *)memory + size);
if (pthread_jit_write_protect_supported_np()) {
//if (pthread_jit_write_protect_supported_np()) {
if (1) {
pthread_jit_write_protect_np(1);
} else {
failed = mprotect(memory, size, PROT_EXEC | PROT_READ);
Expand Down

0 comments on commit 0b7fce8

Please sign in to comment.