[PATCH] D87420: scudo: Introduce a new mechanism to let Scudo access a platform-specific TLS slot

Roland McGrath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 18:59:53 PDT 2020


mcgrathr added a comment.

Looks fine to me.  Thanks!



================
Comment at: compiler-rt/lib/scudo/standalone/tsd_shared.h:91
 #else
-    CHECK_EQ(
-        pthread_setspecific(PThreadKey, reinterpret_cast<void *>(CurrentTSD)),
-        0);
+    return &ThreadTSD;
 #endif
----------------
You could just make it `static thread_local` in this function and not need any other conditionalization declarations below.


================
Comment at: compiler-rt/lib/scudo/standalone/tsd_shared.h:196
   TSD<Allocator> TSDs[TSDsArraySize];
 #if SCUDO_LINUX && !_BIONIC
+  static THREADLOCAL uptr ThreadTSD;
----------------
Should these conditionals be `#if !SCUDO_HAS_PLATFORM_TLS_SLOT` now since the code above won't compile if that's not defined and this isn't declared?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87420/new/

https://reviews.llvm.org/D87420



More information about the llvm-commits mailing list