[PATCH] Generalize stackdepot.

Dmitry Vyukov dvyukov at google.com
Tue May 20 10:55:55 PDT 2014


LGTM

================
Comment at: lib/msan/msan.cc:284
@@ +283,3 @@
+  int use_count = h.use_count();
+  if (use_count > __msan::flags()->origin_history_per_stack_limit)
+    return id;
----------------
Isn't it all in __msan namespace?

================
Comment at: lib/msan/msan.cc:566
@@ -519,1 +565,3 @@
+    bool inserted = ChainedOriginDepotPut(idx, Origin::kStackRoot, &id);
+    CHECK(inserted); // All first time stack origins are unique.
     *id_ptr = id;
----------------
Isn't it subject to races? What if two threads trigger this alloca for the first time?

================
Comment at: lib/msan/msan_allocator.cc:108
@@ -107,1 +107,3 @@
+      ChainedOriginDepotPut(stack_id, Origin::kHeapRoot, &id);
+      __msan_set_origin(allocated, size, Origin(id, 1).raw_id());
     }
----------------
Origin(id, 1)
can't we start depth from 0 here? that would enlarge the maximum chain depth by 1.

http://reviews.llvm.org/D3790






More information about the llvm-commits mailing list