[PATCH] D29993: Use pthreads to store current thread id on darwin

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 19:23:59 PST 2017


kubamracek added inline comments.


================
Comment at: lib/lsan/lsan_common_mac.cc:42
+    thread_local_data_t initialized_struct;
+    internal_memcpy(ptr, &initialized_struct, sizeof(initialized_struct));
     pthread_setspecific(key, ptr);
----------------
Hm, that's weird.  Either use placement new, `new(ptr) thread_local_data_t()`, or just initialize this field-by-field (and remove the default values).


https://reviews.llvm.org/D29993





More information about the llvm-commits mailing list