Skip to content

Commit a3376f7

Browse files
committed
Make thread_local_caching_allocator thread safe
Signed-off-by: Pansysk75 <[email protected]>
1 parent ab3c91f commit a3376f7

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

libs/core/allocator_support/include/hpx/allocator_support/thread_local_caching_allocator.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,12 @@ namespace hpx::util {
8787
throw std::bad_alloc();
8888
}
8989
}
90-
91-
++allocated;
9290
return p;
9391
}
9492

9593
void deallocate(pointer p, size_type n) noexcept
9694
{
9795
data.push(std::make_pair(p, n));
98-
if (++deallocated > 2 * (allocated + 16))
99-
{
100-
clear_cache();
101-
allocated = 0;
102-
deallocated = 0;
103-
}
10496
}
10597

10698
private:
@@ -115,8 +107,6 @@ namespace hpx::util {
115107

116108
HPX_NO_UNIQUE_ADDRESS Allocator alloc;
117109
Stack<std::pair<T*, size_type>, Allocator> data;
118-
std::size_t allocated = 0;
119-
std::size_t deallocated = 0;
120110
};
121111

122112
allocated_cache& cache()

0 commit comments

Comments
 (0)