2022-01-10 19:39:10 +00:00
|
|
|
#include <Common/MemoryTrackerBlockerInThread.h>
|
|
|
|
|
|
|
|
// MemoryTrackerBlockerInThread
|
|
|
|
thread_local uint64_t MemoryTrackerBlockerInThread::counter = 0;
|
|
|
|
thread_local VariableContext MemoryTrackerBlockerInThread::level = VariableContext::Global;
|
2022-07-26 19:03:26 +00:00
|
|
|
|
2022-01-10 19:39:10 +00:00
|
|
|
MemoryTrackerBlockerInThread::MemoryTrackerBlockerInThread(VariableContext level_)
|
|
|
|
: previous_level(level)
|
|
|
|
{
|
|
|
|
++counter;
|
|
|
|
level = level_;
|
|
|
|
}
|
2022-07-26 19:03:26 +00:00
|
|
|
|
|
|
|
MemoryTrackerBlockerInThread::MemoryTrackerBlockerInThread() : MemoryTrackerBlockerInThread(VariableContext::User)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-01-10 19:39:10 +00:00
|
|
|
MemoryTrackerBlockerInThread::~MemoryTrackerBlockerInThread()
|
|
|
|
{
|
|
|
|
--counter;
|
|
|
|
level = previous_level;
|
|
|
|
}
|