[PATCH] D32649: [scudo] Add Android support

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 11:07:00 PDT 2017


alekseyshl added inline comments.


================
Comment at: lib/scudo/scudo_tls_android.h:28
+  }
+  if (atomic_load_relaxed(&UnusedSince) == 0)
+    atomic_store_relaxed(&UnusedSince, NanoTime());
----------------
Can we rename UnusedSince to something else? It's a bit confusing to read the code, it is set when the context is, in fact, in use (by some other thread). How about InSlowLockQueueSince or SlowLockOrder or SlowLockPrecedence? Two latter ones abstract the fact that we use timespamp, which, to me, is a good thing,


================
Comment at: lib/scudo/scudo_tls_linux.h:35
 };
-extern thread_local ThreadState ScudoThreadState;
-extern thread_local ScudoThreadContext ThreadLocalContext;
+__attribute__((tls_model("initial-exec")))
+extern THREADLOCAL ThreadState ScudoThreadState;
----------------
Is the explicit model necessary?


https://reviews.llvm.org/D32649





More information about the llvm-commits mailing list