[all-commits] [llvm/llvm-project] dfd980: sanitizer_common: add simpler ThreadRegistry ctor

Dmitry Vyukov via All-commits all-commits at lists.llvm.org
Tue Jul 13 22:52:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dfd9808b6cea59ff075498ee7e6e57f2b5b3a798
      https://github.com/llvm/llvm-project/commit/dfd9808b6cea59ff075498ee7e6e57f2b5b3a798
  Author: Dmitry Vyukov <dvyukov at google.com>
  Date:   2021-07-13 (Tue, 13 Jul 2021)

  Changed paths:
    M compiler-rt/lib/asan/asan_thread.cpp
    M compiler-rt/lib/asan/asan_thread.h
    M compiler-rt/lib/lsan/lsan_thread.cpp
    M compiler-rt/lib/memprof/memprof_thread.cpp
    M compiler-rt/lib/memprof/memprof_thread.h
    M compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h
    M compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cpp

  Log Message:
  -----------
  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




More information about the All-commits mailing list