[PATCH] [lsan] Introduce __lsan_(un)register_root_region().

Alexey Samsonov samsonov at google.com
Mon Dec 16 23:45:35 PST 2013


  LGTM (with minor nits).


================
Comment at: lib/lsan/lsan_common.cc:17
@@ -16,2 +16,3 @@
 
+#include "sanitizer_common/sanitizer_procmaps.h"
 #include "sanitizer_common/sanitizer_common.h"
----------------
nit: keep headers sorted

================
Comment at: lib/lsan/lsan_common.cc:99
@@ -95,1 +98,3 @@
 
+struct Region {
+  const void *begin;
----------------
nit: s/Region/RootRegion

================
Comment at: lib/lsan/lsan_common.cc:108
@@ +107,3 @@
+  CHECK(!root_regions);
+  ALIGNED(64) static char placeholder_[sizeof(InternalMmapVector<Region>)];
+  root_regions = new(placeholder_) InternalMmapVector<Region>(1);
----------------
nit: s/placeholder_/placeholder

================
Comment at: lib/lsan/lsan_common.cc:627
@@ +626,3 @@
+#if CAN_SANITIZE_LEAKS
+  BlockingMutexLock l(&global_mutex);
+  CHECK(root_regions);
----------------
Update the comment for global_mutex declaration

================
Comment at: lib/lsan/lsan_common.cc:272
@@ +271,3 @@
+                        &prot)) {
+    uptr intersection_begin, intersection_end;
+    intersection_begin = Max(root_begin, begin);
----------------
nit: combine declaration with initialization


http://llvm-reviews.chandlerc.com/D2417

BRANCH
  feat/lsan/live_range

ARCANIST PROJECT
  compiler-rt



More information about the llvm-commits mailing list