[compiler-rt] 1455b55 - tsan: de-hardcode MemCount const

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 07:11:54 PDT 2021


Author: Dmitry Vyukov
Date: 2021-09-27T16:11:49+02:00
New Revision: 1455b552b764ecf4b95c8307cceb4a0d7290629d

URL: https://github.com/llvm/llvm-project/commit/1455b552b764ecf4b95c8307cceb4a0d7290629d
DIFF: https://github.com/llvm/llvm-project/commit/1455b552b764ecf4b95c8307cceb4a0d7290629d.diff

LOG: tsan: de-hardcode MemCount const

Use MemCount instead of hard-coded value 7.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D110532

Added: 
    

Modified: 
    compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp b/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
index bb5ced75e4b1..a8b5403d0b82 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
@@ -122,7 +122,7 @@ void FillProfileCallback(uptr p, uptr rss, bool file,
 void WriteMemoryProfile(char *buf, uptr buf_size, u64 uptime_ns) {
   uptr mem[MemCount];
   internal_memset(mem, 0, sizeof(mem));
-  GetMemoryProfile(FillProfileCallback, mem, 7);
+  GetMemoryProfile(FillProfileCallback, mem, MemCount);
   auto meta = ctx->metamap.GetMemoryStats();
   StackDepotStats *stacks = StackDepotGetStats();
   uptr nthread, nlive;


        


More information about the llvm-commits mailing list