mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 08:52:06 +00:00
23 lines
620 B
C++
23 lines
620 B
C++
#include <Common/MemoryTrackerBlockerInThread.h>
|
|
|
|
// MemoryTrackerBlockerInThread
|
|
thread_local uint64_t MemoryTrackerBlockerInThread::counter = 0;
|
|
thread_local VariableContext MemoryTrackerBlockerInThread::level = VariableContext::Global;
|
|
|
|
MemoryTrackerBlockerInThread::MemoryTrackerBlockerInThread(VariableContext level_)
|
|
: previous_level(level)
|
|
{
|
|
++counter;
|
|
level = level_;
|
|
}
|
|
|
|
MemoryTrackerBlockerInThread::MemoryTrackerBlockerInThread() : MemoryTrackerBlockerInThread(VariableContext::User)
|
|
{
|
|
}
|
|
|
|
MemoryTrackerBlockerInThread::~MemoryTrackerBlockerInThread()
|
|
{
|
|
--counter;
|
|
level = previous_level;
|
|
}
|