File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
compiler-rt/lib/scudo/standalone Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,7 @@ static void stressSharedRegistry(MockAllocator<SharedCaches> *Allocator) {
201
201
202
202
TEST (ScudoTSDTest, TSDRegistryTSDsCount) {
203
203
Ready = false ;
204
+ Pointers.clear ();
204
205
using AllocatorT = MockAllocator<SharedCaches>;
205
206
auto Deleter = [](AllocatorT *A) {
206
207
A->unmapTestOnly ();
Original file line number Diff line number Diff line change @@ -43,7 +43,14 @@ template <class Allocator> struct TSDRegistryExT {
43
43
initLinkerInitialized (Instance); // Sets Initialized.
44
44
}
45
45
46
- void unmapTestOnly () {}
46
+ void unmapTestOnly () {
47
+ Allocator *Instance =
48
+ reinterpret_cast <Allocator *>(pthread_getspecific (PThreadKey));
49
+ if (!Instance)
50
+ return ;
51
+ ThreadTSD.commitBack (Instance);
52
+ State = {};
53
+ }
47
54
48
55
ALWAYS_INLINE void initThreadMaybe (Allocator *Instance, bool MinimalInit) {
49
56
if (LIKELY (State.InitState != ThreadState::NotInitialized))
You can’t perform that action at this time.
0 commit comments