forked from OSchip/llvm-project
[scudo][NFC] Make tests runs with --gtest_repeat=2
Reviewed By: cryptoad Differential Revision: https://reviews.llvm.org/D99766
This commit is contained in:
parent
ce9e1a3632
commit
622500479b
|
@ -201,6 +201,7 @@ static void stressSharedRegistry(MockAllocator<SharedCaches> *Allocator) {
|
|||
|
||||
TEST(ScudoTSDTest, TSDRegistryTSDsCount) {
|
||||
Ready = false;
|
||||
Pointers.clear();
|
||||
using AllocatorT = MockAllocator<SharedCaches>;
|
||||
auto Deleter = [](AllocatorT *A) {
|
||||
A->unmapTestOnly();
|
||||
|
|
|
@ -43,7 +43,14 @@ template <class Allocator> struct TSDRegistryExT {
|
|||
initLinkerInitialized(Instance); // Sets Initialized.
|
||||
}
|
||||
|
||||
void unmapTestOnly() {}
|
||||
void unmapTestOnly() {
|
||||
Allocator *Instance =
|
||||
reinterpret_cast<Allocator *>(pthread_getspecific(PThreadKey));
|
||||
if (!Instance)
|
||||
return;
|
||||
ThreadTSD.commitBack(Instance);
|
||||
State = {};
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void initThreadMaybe(Allocator *Instance, bool MinimalInit) {
|
||||
if (LIKELY(State.InitState != ThreadState::NotInitialized))
|
||||
|
|
Loading…
Reference in New Issue