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

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 21 12:29:17 PDT 2018


kubamracek added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_posix_libcdep.cc:331
+// giant memory regions.
+#define kXnuFastMmapFd 0x4
+bool use_xnu_fast_mmap = false;
----------------
delcypher wrote:
> 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?
We don't want to use this flag in internal_mmap, that would apply to all mmap calls. We really only want this flag for the shadow memory. I can add another argument to internal_mmap, but that looks to me like it would complicate things more than clarify them.


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


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D48445





More information about the llvm-commits mailing list