zhiqiang-hhhh commented on code in PR #37066: URL: https://github.com/apache/doris/pull/37066#discussion_r1665299420
########## be/src/runtime/thread_context.h: ########## @@ -460,17 +478,22 @@ class ScopeSkipMemoryCheck { // Mem Hook to consume thread mem tracker #define CONSUME_THREAD_MEM_TRACKER_BY_HOOK(size) \ do { \ + allocator_detect(size); \ if (doris::use_mem_hook) { \ doris::thread_context()->consume_memory(size); \ } \ } while (0) + #define RELEASE_THREAD_MEM_TRACKER_BY_HOOK(size) CONSUME_THREAD_MEM_TRACKER_BY_HOOK(-size) + #define CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(size_fn, ...) \ do { \ + allocator_detect(size_fn(__VA_ARGS__)); \ Review Comment: function all will be erased with -O3 ########## be/src/runtime/thread_context.h: ########## @@ -460,17 +478,22 @@ class ScopeSkipMemoryCheck { // Mem Hook to consume thread mem tracker #define CONSUME_THREAD_MEM_TRACKER_BY_HOOK(size) \ do { \ + allocator_detect(size); \ if (doris::use_mem_hook) { \ doris::thread_context()->consume_memory(size); \ } \ } while (0) + #define RELEASE_THREAD_MEM_TRACKER_BY_HOOK(size) CONSUME_THREAD_MEM_TRACKER_BY_HOOK(-size) + #define CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(size_fn, ...) \ do { \ + allocator_detect(size_fn(__VA_ARGS__)); \ Review Comment: function call will be erased with -O3 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org