[PATCH] D21086: [esan] Intercept calloc to avoid deadlocks with tcmalloc

Mike Aizatsky via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 13:46:39 PDT 2016


aizatsky requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: lib/esan/esan_interceptors.cpp:431
@@ +430,3 @@
+  CHECK(!used_early_alloc_buf && size < sizeof(early_alloc_buf));
+  used_early_alloc_buf = true;
+  return (void *)early_alloc_buf;
----------------
Is there a multi-threading concern here? I assume tcmalloc initializes in one thread only?

================
Comment at: lib/esan/esan_interceptors.cpp:450
@@ +449,3 @@
+  if (p == (void *)early_alloc_buf)
+    return;
+  REAL(free)(p);
----------------
Do you want to clear used_early_alloc_buf here?


http://reviews.llvm.org/D21086





More information about the llvm-commits mailing list