[PATCH] [Tsan] Add support for FreeBSD memory layout

Ed Maste emaste at freebsd.org
Wed Oct 22 13:45:26 PDT 2014


================
Comment at: lib/tsan/rtl/tsan_platform_linux.cc:12
@@ -11,3 +11,3 @@
 //
 // Linux-specific code.
 //===----------------------------------------------------------------------===//
----------------
Should be `Linux- and FreeBSD-specific code.` I think - and would be useful to explain why the FreeBSD code is in the _linux.cc file.

================
Comment at: lib/tsan/rtl/tsan_platform_linux.cc:267
@@ +266,3 @@
+#if SANITIZER_FREEBSD
+  MmapShadow(kLinuxLowShadowBeg, kLinuxLowShadowEnd,
+             kLinuxLowAppMemBeg, kLinuxLowAppMemEnd,
----------------
It's rather confusing for these constants to be named kLinux... for the FreeBSD-specific code.

Would it be OK for these to be `kLowShadowBeg` etc.?

================
Comment at: lib/tsan/rtl/tsan_platform_linux.cc:323
@@ +322,3 @@
+#if SANITIZER_FREEBSD
+  const uptr modules = 0x000001000000;
+#else
----------------
Why is this one a bare constant here rather than some `k` constant?

http://reviews.llvm.org/D5709






More information about the llvm-commits mailing list