1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

fix(perf,allocator): adding unit test to check CountingAllocator behavior when it is wrapped in STLPoolAllocator

This commit is contained in:
drrtuy
2025-04-25 22:03:51 +00:00
parent 671b7301f3
commit 252b3ddbef
8 changed files with 277 additions and 12 deletions

View File

@ -41,6 +41,16 @@ inline int64_t atomicSubRef(std::atomic<int64_t>& ref, int64_t val)
{
return ref.fetch_sub(val, std::memory_order_relaxed);
}
inline void atomicStoreRef(std::atomic<int64_t>& ref, int64_t val)
{
ref.store(val, std::memory_order_relaxed);
}
inline int64_t atomicLoadRef(const std::atomic<int64_t>& ref)
{
return ref.load(std::memory_order_relaxed);
}
// Returns the resulting, incremented value
template <typename T>
inline T atomicInc(volatile T* mem)