[PATCH] Run the callback on a separate stack in StopTheWorld.

Alexander Potapenko glider at google.com
Fri Mar 29 05:41:27 PDT 2013



================
Comment at: lib/sanitizer_common/sanitizer_stoptheworld_linux.cc:259
@@ +258,3 @@
+                             "ScopedStackWithGuard");
+    void *res = Mprotect((uptr)guard_start_, guard_size_);
+    CHECK_EQ(res, guard_start_);
----------------
Kostya Serebryany wrote:
> CHECK_EQ(guard_size, Mprotect(...))
Please be consistent with spaces when you're declaring pointers: either "void *res" or "void* res"
I know it's different across the codebase, but please choose one within a single file.

================
Comment at: lib/sanitizer_common/sanitizer_stoptheworld_linux.cc:257
@@ +256,3 @@
+    guard_size_ = GetPageSizeCached();
+    guard_start_ = MmapOrDie(stack_size_ + guard_size_,
+                             "ScopedStackWithGuard");
----------------
You're silently omitting MAP_STACK, which is currently a no-op but may be implemented later in the kernel.
It's fine to keep it for now, but please add a comment regarding that.

================
Comment at: lib/sanitizer_common/sanitizer_stoptheworld_linux.cc:265
@@ +264,3 @@
+  }
+  void *Bottom() {
+    return (void *)((uptr)guard_start_ + stack_size_ + guard_size_);
----------------
const


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



More information about the llvm-commits mailing list