1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

feat(): change ref to atomic with ptr to atomic

This commit is contained in:
drrtuy
2024-12-08 22:23:33 +00:00
parent 71ed9cabe0
commit 397b3ff729
4 changed files with 19 additions and 19 deletions

View File

@ -47,7 +47,7 @@ class CountingAllocatorTest : public ::testing::Test
// Constructor
CountingAllocatorTest()
: allocatedMemory(MemoryAllowance), allocator(allocatedMemory, MemoryAllowance / 100)
: allocatedMemory(MemoryAllowance), allocator(&allocatedMemory, MemoryAllowance / 100)
{
}
@ -79,12 +79,12 @@ TEST_F(CountingAllocatorTest, Deallocation)
// Test 3: Allocator equality based on shared counter
TEST_F(CountingAllocatorTest, AllocatorEquality)
{
CountingAllocator<TestClass> allocator1(allocatedMemory);
CountingAllocator<TestClass> allocator2(allocatedMemory);
CountingAllocator<TestClass> allocator1(&allocatedMemory);
CountingAllocator<TestClass> allocator2(&allocatedMemory);
EXPECT_TRUE(allocator1 == allocator2);
std::atomic<int64_t> anotherCounter(0);
CountingAllocator<TestClass> allocator3(anotherCounter);
CountingAllocator<TestClass> allocator3(&anotherCounter);
EXPECT_FALSE(allocator1 == allocator3);
}