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

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 16:21:18 PDT 2017


alekseyshl 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));
----------------
dvyukov wrote:
> 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.
Well, not sure about a few lines, but will do. It just seem weird to mention errno in the code which does not care about errno at all. Maybe user_alloc_internal?


https://reviews.llvm.org/D35690





More information about the llvm-commits mailing list