Skip to content

Commit 3f87e29

Browse files
committed
Do not use prctl to name Virt mem on Mac
1 parent cef2d0c commit 3f87e29

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ project(rlbox_wasm2c
77

88
# Project Settings ###################
99

10-
# set(CMAKE_VERBOSE_MAKEFILE ON)
10+
# set(CMAKE_VERBOSE_MAKEFILE wasm2c: support the custom-page-sizes proposal #2508 ON)
1111
set(CMAKE_CXX_STANDARD 17)
1212
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1313
set(CMAKE_CXX_EXTENSIONS OFF)
@@ -122,7 +122,7 @@ endif()
122122
FetchContent_Declare(
123123
mod_wasm2c
124124
GIT_REPOSITORY https://github.com/WebAssembly/wabt/
125-
GIT_TAG main)
125+
GIT_TAG 40be47dbfceea07951325dd2197a96c74d8c77a8)
126126
FetchContent_GetProperties(mod_wasm2c)
127127
if(NOT mod_wasm2c_POPULATED)
128128
FetchContent_Populate(mod_wasm2c)

src/wasm2c_rt_mem.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ static int os_mmap_commit(void* curr_heap_end_pointer,
315315

316316
# include <sys/mman.h>
317317
# include <unistd.h>
318+
#if !(defined(__APPLE__) && defined(__MACH__))
318319
# include <sys/prctl.h>
320+
#endif
319321

320322
// These constants are copied from <sys/prctl.h>, because the headers
321323
// used for building may not have them even though the running kernel
@@ -429,12 +431,14 @@ static void* os_mmap_aligned(void* addr,
429431
}
430432
}
431433

434+
#if !(defined(__APPLE__) && defined(__MACH__))
432435
if (name) {
433436
// Ignore errors here as this is best effort
434437
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME,
435438
(unsigned long)aligned, requested_length,
436439
(unsigned long)name);
437440
}
441+
#endif
438442

439443
return (void*)aligned;
440444
}

0 commit comments

Comments
 (0)