sanitizer_common: add simpler ThreadRegistry ctor
authorDmitry Vyukov <dvyukov@google.com>
Fri, 9 Jul 2021 16:34:30 +0000 (18:34 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Sun, 11 Jul 2021 10:36:28 +0000 (12:36 +0200)
commit8e489b4b96e31cfb004e03cfa1393c425c504013
treec96ef028f3e7fd9a72caa07a19b5e9cc6bdc22d0
parent6775fc6ffa3ca1c36b20c25fa4e7f48f81213cf2
sanitizer_common: add simpler ThreadRegistry ctor

Currently ThreadRegistry is overcomplicated because of tsan,
it needs tid quarantine and reuse counters. Other sanitizers
don't need that. It also seems that no other sanitizer now
needs max number of threads. Asan used to need 2^24 limit,
but it does not seem to be needed now. Other sanitizers blindly
copy-pasted that without reasons. Lsan also uses quarantine,
but I don't see why that may be potentially needed.

Add a ThreadRegistry ctor that does not require any sizes
and use it in all sanitizers except for tsan.
In preparation for new tsan runtime, which won't need
any of these parameters as well.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D105713
compiler-rt/lib/asan/asan_thread.cpp
compiler-rt/lib/asan/asan_thread.h
compiler-rt/lib/lsan/lsan_thread.cpp
compiler-rt/lib/memprof/memprof_thread.cpp
compiler-rt/lib/memprof/memprof_thread.h
compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.cpp
compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h