1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Noticed another deadlock possibility in PoolAllocator.

Also currently not a problem.
This commit is contained in:
Patrick LeBlanc
2020-01-03 17:29:39 -05:00
parent 8b6d004523
commit d47df1b6dd

View File

@ -71,16 +71,11 @@ void * PoolAllocator::allocOOB(uint64_t size)
bool _false = false;
OOBMemInfo memInfo;
if (useLock)
while (!lock.compare_exchange_weak(_false, true, std::memory_order_acquire))
_false = false;
memUsage += size;
memInfo.mem.reset(new uint8_t[size]);
memInfo.size = size;
void *ret = (void*) memInfo.mem.get();
oob[ret] = memInfo;
if (useLock)
lock.store(false, std::memory_order_release);
return ret;
}