[PATCH] D48445: [sanitizer] Use "fast mmap" kernel flag for shadow memory on macOS 10.13.4+

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 21 11:55:58 PDT 2018


delcypher requested changes to this revision.
delcypher added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/sanitizer_common/sanitizer_posix_libcdep.cc:331
+// giant memory regions.
+#define kXnuFastMmapFd 0x4
+bool use_xnu_fast_mmap = false;
----------------
Is there a reason the `use_xnu_fast_mmap` isn't pushed into the Darwin implementation of `internal_mmap()`? Wouldn't it make more sense to be there given that xnu_fast_mmap is Darwin specific?


================
Comment at: lib/sanitizer_common/sanitizer_posix_libcdep.cc:391
   if (fd == -1) flags |= MAP_ANON;
+  if (fd == -1 && use_xnu_fast_mmap) fd = kXnuFastMmapFd;
 
----------------
Again can't we move this into the Darwin implementation of `internal_mmap()`. This will also mean we avoid duplicating code.


================
Comment at: lib/tsan/rtl/tsan_rtl.cc:361
+  __sanitizer::InitializePlatformEarly();
   InitializePlatformEarly();
+
----------------
`__sanitizer::InitializePlatformEarly()` is different from `InitializePlatformEarly()` that's called immediately afterwards?


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D48445





More information about the llvm-commits mailing list