[PATCH] D35690: [Sanitizers] TSan allocator set errno on failure.

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 10:49:15 PDT 2017


dvyukov added inline comments.


================
Comment at: lib/tsan/rtl/tsan_mman.cc:174
 
+void *tsan_malloc(ThreadState *thr, uptr pc, uptr sz) {
+  return SetErrnoOnNull(user_alloc(thr, pc, sz, kDefaultAlignment));
----------------
Please don't prefix functions, variables and types in tsan with tsan. It's all tsan already. It's just plain pointless to prefix everything in tsan with tsan, everything in asan with asan, etc, and does not add any information for reader about purpose of a function or a type.

Also, diff will be much smaller if you name this function user_alloc and rename the old one to, say, user_alloc_noerrno. It will be just few lines instead of churning the whole codebase.


https://reviews.llvm.org/D35690





More information about the llvm-commits mailing list