From c638a7127e060b5cbeae5f364ca1de0efa852cbe Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 20 Mar 2013 13:50:47 +0000 Subject: [PATCH] tsan: reduce size of mutexsets from 64 to 16 mutexes overflow is handled anyway saves memory because each thread holds 1024 mutexsets llvm-svn: 177520 --- compiler-rt/lib/tsan/lit_tests/java_lock.cc | 2 ++ compiler-rt/lib/tsan/rtl/tsan_mutexset.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/tsan/lit_tests/java_lock.cc b/compiler-rt/lib/tsan/lit_tests/java_lock.cc index f66f1e7..d9db103 100644 --- a/compiler-rt/lib/tsan/lit_tests/java_lock.cc +++ b/compiler-rt/lib/tsan/lit_tests/java_lock.cc @@ -1,10 +1,12 @@ // RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s #include "java.h" +#include jptr varaddr; jptr lockaddr; void *Thread(void *p) { + sleep(1); __tsan_java_mutex_lock(lockaddr); *(int*)varaddr = 42; __tsan_java_mutex_unlock(lockaddr); diff --git a/compiler-rt/lib/tsan/rtl/tsan_mutexset.h b/compiler-rt/lib/tsan/rtl/tsan_mutexset.h index 09223ff..eebfd4d 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_mutexset.h +++ b/compiler-rt/lib/tsan/rtl/tsan_mutexset.h @@ -22,7 +22,7 @@ class MutexSet { public: // Holds limited number of mutexes. // The oldest mutexes are discarded on overflow. - static const uptr kMaxSize = 64; + static const uptr kMaxSize = 16; struct Desc { u64 id; u64 epoch; -- 2.7.4