You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
boost::atomic -> std::atomic
This commit is contained in:
@ -31,7 +31,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <boost/shared_array.hpp>
|
#include <boost/shared_array.hpp>
|
||||||
#include <boost/atomic.hpp>
|
#include <atomic>
|
||||||
|
|
||||||
namespace utils
|
namespace utils
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ private:
|
|||||||
uint64_t memUsage;
|
uint64_t memUsage;
|
||||||
uint8_t* nextAlloc;
|
uint8_t* nextAlloc;
|
||||||
bool useLock;
|
bool useLock;
|
||||||
boost::atomic<bool> lock;
|
std::atomic<bool> lock;
|
||||||
|
|
||||||
struct OOBMemInfo
|
struct OOBMemInfo
|
||||||
{
|
{
|
||||||
@ -107,14 +107,14 @@ inline void* PoolAllocator::allocate(uint64_t size)
|
|||||||
bool _false = false;
|
bool _false = false;
|
||||||
|
|
||||||
if (useLock)
|
if (useLock)
|
||||||
while (!lock.compare_exchange_weak(_false, true, boost::memory_order_acquire))
|
while (!lock.compare_exchange_weak(_false, true, std::memory_order_acquire))
|
||||||
_false = false;
|
_false = false;
|
||||||
|
|
||||||
if (size > allocSize)
|
if (size > allocSize)
|
||||||
{
|
{
|
||||||
ret = allocOOB(size);
|
ret = allocOOB(size);
|
||||||
if (useLock)
|
if (useLock)
|
||||||
lock.store(false, boost::memory_order_release);
|
lock.store(false, std::memory_order_release);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ inline void* PoolAllocator::allocate(uint64_t size)
|
|||||||
capacityRemaining -= size;
|
capacityRemaining -= size;
|
||||||
memUsage += size;
|
memUsage += size;
|
||||||
if (useLock)
|
if (useLock)
|
||||||
lock.store(false, boost::memory_order_release);
|
lock.store(false, std::memory_order_release);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user