From 8ccc61b3bf321eb93914c201e8609a45ed18aab9 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 14 Apr 2021 23:19:53 +0300 Subject: [PATCH] Block all memory tracking limits in SCOPE_EXIT_*SAFE --- base/ext/scope_guard_safe.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/base/ext/scope_guard_safe.h b/base/ext/scope_guard_safe.h index 7cfb3959a81..55140213572 100644 --- a/base/ext/scope_guard_safe.h +++ b/base/ext/scope_guard_safe.h @@ -12,7 +12,8 @@ /// /// NOTE: it should be used with caution. #define SCOPE_EXIT_MEMORY(...) SCOPE_EXIT( \ - MemoryTracker::LockExceptionInThread lock_memory_tracker; \ + MemoryTracker::LockExceptionInThread \ + lock_memory_tracker(VariableContext::Global); \ __VA_ARGS__; \ ) @@ -56,7 +57,8 @@ #define SCOPE_EXIT_MEMORY_SAFE(...) SCOPE_EXIT( \ try \ { \ - MemoryTracker::LockExceptionInThread lock_memory_tracker; \ + MemoryTracker::LockExceptionInThread \ + lock_memory_tracker(VariableContext::Global); \ __VA_ARGS__; \ } \ catch (...) \