[NFC][sanitizer] Add class to track thread arg and retval
authorVitaly Buka <vitalybuka@google.com>
Mon, 8 May 2023 07:10:03 +0000 (00:10 -0700)
committerVitaly Buka <vitalybuka@google.com>
Thu, 11 May 2023 21:43:48 +0000 (14:43 -0700)
commitc45ee7c0fba8daa2b5b6b201faa99d02c01cce8b
tree7fe8b69e1181eb7bea6f8cf4c885f4832577dd3a
parent1c3a2069ca0c964cefaadd00a9e7feed8725851d
[NFC][sanitizer] Add class to track thread arg and retval

We need something to keep arg and retval pointers for leak checking.
Pointers should keept alive even after thread exited, until the thread
is detached or joined.
We should not put this logic into ThreadRegistry as we need the the
same for the ThreadList of HWASAN.

Reviewed By: thurston

Differential Revision: https://reviews.llvm.org/D150104
compiler-rt/lib/sanitizer_common/CMakeLists.txt
compiler-rt/lib/sanitizer_common/sanitizer_thread_arg_retval.cpp [new file with mode: 0644]
compiler-rt/lib/sanitizer_common/sanitizer_thread_arg_retval.h [new file with mode: 0644]
compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_arg_retval_test.cpp [new file with mode: 0644]