From e8b5e51b00aa0a10279f71b53412239de9eeb2dd Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Mon, 10 Jun 2024 15:06:39 -0700 Subject: [PATCH] Change macOS mmap tag to fix conflict with IOAccelerator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tag 100 is assigned to "IOAccelerator" (the GPU driver stack on Apple silicon), which makes for confusing output when debugging. To avoid conflicts, use a tag in the reserved application-specific range from 240–255 (inclusive). All assigned tags: https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/osfmk/mach/vm_statistics.h#L773-L775 --- src/prim/unix/prim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prim/unix/prim.c b/src/prim/unix/prim.c index 63a36f259..c3f36e2af 100644 --- a/src/prim/unix/prim.c +++ b/src/prim/unix/prim.c @@ -240,7 +240,7 @@ static int unix_mmap_fd(void) { #if defined(VM_MAKE_TAG) // macOS: tracking anonymous page with a specific ID. (All up to 98 are taken officially but LLVM sanitizers had taken 99) int os_tag = (int)mi_option_get(mi_option_os_tag); - if (os_tag < 100 || os_tag > 255) { os_tag = 100; } + if (os_tag < 100 || os_tag > 255) { os_tag = 254; } return VM_MAKE_TAG(os_tag); #else return -1;