Skip to content

Commit 1dfaf7f

Browse files
loneyleekyligence-git
authored andcommitted
[GLUTEN-5476] Add current_memory function ref (#488)
(cherry picked from commit fe75cd3)
1 parent d9d9777 commit 1dfaf7f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/Common/CurrentMemoryTracker.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ using DB::current_thread;
3939
thread_local std::function<void(Int64, bool)> CurrentMemoryTracker::before_alloc = nullptr;
4040

4141
thread_local std::function<void(Int64)> CurrentMemoryTracker::before_free = nullptr;
42+
thread_local std::function<Int64()> CurrentMemoryTracker::current_memory = nullptr;
4243

4344
AllocationTrace CurrentMemoryTracker::allocImpl(Int64 size, bool throw_if_memory_exceeded)
4445
{

src/Common/CurrentMemoryTracker.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ struct CurrentMemoryTracker
1919

2020
static thread_local std::function<void(Int64, bool)> before_alloc;
2121
static thread_local std::function<void(Int64)> before_free;
22+
static thread_local std::function<Int64()> current_memory;
2223
private:
2324
[[nodiscard]] static AllocationTrace allocImpl(Int64 size, bool throw_if_memory_exceeded);
2425
};

0 commit comments

Comments
 (0)