github-actions[bot] commented on code in PR #33897:
URL: https://github.com/apache/doris/pull/33897#discussion_r1572153364


##########
be/src/runtime/memory/jemalloc_hook.cpp:
##########
@@ -15,213 +15,191 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <features.h>
-#include <stdint.h>
-#include <stdlib.h>
+#include <jemalloc/jemalloc.h>

Review Comment:
   warning: 'jemalloc/jemalloc.h' file not found [clang-diagnostic-error]
   ```cpp
   #include <jemalloc/jemalloc.h>
            ^
   ```
   



##########
be/src/runtime/memory/jemalloc_hook.cpp:
##########
@@ -15,213 +15,191 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <features.h>
-#include <stdint.h>
-#include <stdlib.h>
+#include <jemalloc/jemalloc.h>
 
-#include "common/compiler_util.h" // IWYU pragma: keep
-#include "jemalloc/jemalloc.h"
+#include "common/status.h"
 #include "runtime/thread_context.h"
-#include "util/sse_util.hpp"
 
-#ifndef __THROW
-#if __cplusplus
-#define __THROW noexcept
-#else
-#define __THROW
-#endif
-#endif
+namespace {
 
 extern "C" {
-
-// Both je_nallocx and je_malloc will use the lock je_malloc_mutex_lock_slow,
-// so enabling the jemalloc hook will double the lock usage.
-// In extreme cases this will affect performance, consider turning off mem hook
-// mem hook should avoid nesting new/malloc.
-
-void* doris_malloc(size_t size) __THROW {
-    CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
jenallocx(size, 0); },
-                                               size);
-    void* ptr = jemalloc(size);
-    if (UNLIKELY(ptr == nullptr)) {
-        RELEASE_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
jenallocx(size, 0); },
-                                                   size);
-    }
-    return ptr;
-}
-
-void doris_free(void* p) __THROW {
-    RELEASE_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](void* p) { return 
jemalloc_usable_size(p); }, p);
-    jefree(p);
-}
-
-void* doris_realloc(void* p, size_t size) __THROW {
-    if (UNLIKELY(size == 0)) {
-        return nullptr;
+#define HOOK_MAX 4
+

Review Comment:
   warning: replace macro with enum [modernize-macro-to-enum]
   
   ```suggestion
   enum {
   HOOK_MAX = 4};
   
   ```
   



##########
be/src/runtime/memory/jemalloc_hook.cpp:
##########
@@ -15,213 +15,191 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <features.h>
-#include <stdint.h>
-#include <stdlib.h>
+#include <jemalloc/jemalloc.h>
 
-#include "common/compiler_util.h" // IWYU pragma: keep
-#include "jemalloc/jemalloc.h"
+#include "common/status.h"
 #include "runtime/thread_context.h"
-#include "util/sse_util.hpp"
 
-#ifndef __THROW
-#if __cplusplus
-#define __THROW noexcept
-#else
-#define __THROW
-#endif
-#endif
+namespace {
 
 extern "C" {
-
-// Both je_nallocx and je_malloc will use the lock je_malloc_mutex_lock_slow,
-// so enabling the jemalloc hook will double the lock usage.
-// In extreme cases this will affect performance, consider turning off mem hook
-// mem hook should avoid nesting new/malloc.
-
-void* doris_malloc(size_t size) __THROW {
-    CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
jenallocx(size, 0); },
-                                               size);
-    void* ptr = jemalloc(size);
-    if (UNLIKELY(ptr == nullptr)) {
-        RELEASE_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
jenallocx(size, 0); },
-                                                   size);
-    }
-    return ptr;
-}
-
-void doris_free(void* p) __THROW {
-    RELEASE_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](void* p) { return 
jemalloc_usable_size(p); }, p);
-    jefree(p);
-}
-
-void* doris_realloc(void* p, size_t size) __THROW {
-    if (UNLIKELY(size == 0)) {
-        return nullptr;
+#define HOOK_MAX 4
+
+enum hook_alloc_e {
+    hook_alloc_malloc,
+    hook_alloc_posix_memalign,
+    hook_alloc_aligned_alloc,
+    hook_alloc_calloc,
+    hook_alloc_memalign,
+    hook_alloc_valloc,
+    hook_alloc_mallocx,
+
+    /* The reallocating functions have both alloc and dalloc variants */
+    hook_alloc_realloc,
+    hook_alloc_rallocx,
+};
+/*
+ * We put the enum typedef after the enum, since this file may get included by
+ * jemalloc_cpp.cpp, and C++ disallows enum forward declarations.
+ */
+using hook_alloc_t = enum hook_alloc_e;
+
+enum hook_dalloc_e {
+    hook_dalloc_free,
+    hook_dalloc_dallocx,
+    hook_dalloc_sdallocx,
+
+    /*
+        * The dalloc halves of reallocation (not called if in-place expansion
+        * happens).
+        */
+    hook_dalloc_realloc,
+    hook_dalloc_rallocx,
+};
+using hook_dalloc_t = enum hook_dalloc_e;
+
+enum hook_expand_e {
+    hook_expand_realloc,
+    hook_expand_rallocx,
+    hook_expand_xallocx,
+};
+using hook_expand_t = enum hook_expand_e;
+
+using hook_alloc = void (*)(void* extra, hook_alloc_t type, void* result, 
uintptr_t result_raw,
+                            uintptr_t args_raw[3]);
+
+using hook_dalloc = void (*)(void* extra, hook_dalloc_t type, void* address, 
uintptr_t args_raw[3]);
+
+using hook_expand = void (*)(void* extra, hook_expand_t type, void* address, 
size_t old_usize,
+                             size_t new_usize, uintptr_t result_raw, uintptr_t 
args_raw[4]);
+
+using hooks_t = struct hooks_s;
+struct hooks_s {
+    hook_alloc alloc_hook;
+    hook_dalloc dalloc_hook;
+    hook_expand expand_hook;
+    void* extra;
+};
+
+void doris_hook_alloc(void* extra, hook_alloc_t type, void* result, uintptr_t 
result_raw,
+                      uintptr_t args_raw[3]) {

Review Comment:
   warning: pointer parameter 'args_raw' can be pointer to const 
[readability-non-const-parameter]
   
   ```suggestion
                         const uintptr_t args_raw[3]) {
   ```
   



##########
be/src/runtime/memory/jemalloc_hook.cpp:
##########
@@ -15,213 +15,191 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <features.h>
-#include <stdint.h>
-#include <stdlib.h>
+#include <jemalloc/jemalloc.h>
 
-#include "common/compiler_util.h" // IWYU pragma: keep
-#include "jemalloc/jemalloc.h"
+#include "common/status.h"
 #include "runtime/thread_context.h"
-#include "util/sse_util.hpp"
 
-#ifndef __THROW
-#if __cplusplus
-#define __THROW noexcept
-#else
-#define __THROW
-#endif
-#endif
+namespace {
 
 extern "C" {
-
-// Both je_nallocx and je_malloc will use the lock je_malloc_mutex_lock_slow,
-// so enabling the jemalloc hook will double the lock usage.
-// In extreme cases this will affect performance, consider turning off mem hook
-// mem hook should avoid nesting new/malloc.
-
-void* doris_malloc(size_t size) __THROW {
-    CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
jenallocx(size, 0); },
-                                               size);
-    void* ptr = jemalloc(size);
-    if (UNLIKELY(ptr == nullptr)) {
-        RELEASE_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
jenallocx(size, 0); },
-                                                   size);
-    }
-    return ptr;
-}
-
-void doris_free(void* p) __THROW {
-    RELEASE_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](void* p) { return 
jemalloc_usable_size(p); }, p);
-    jefree(p);
-}
-
-void* doris_realloc(void* p, size_t size) __THROW {
-    if (UNLIKELY(size == 0)) {
-        return nullptr;
+#define HOOK_MAX 4

Review Comment:
   warning: macro 'HOOK_MAX' defines an integral constant; prefer an enum 
instead [modernize-macro-to-enum]
   ```cpp
   #define HOOK_MAX 4
           ^
   ```
   



##########
be/src/runtime/memory/jemalloc_hook.cpp:
##########
@@ -15,213 +15,191 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <features.h>
-#include <stdint.h>
-#include <stdlib.h>
+#include <jemalloc/jemalloc.h>
 
-#include "common/compiler_util.h" // IWYU pragma: keep
-#include "jemalloc/jemalloc.h"
+#include "common/status.h"
 #include "runtime/thread_context.h"
-#include "util/sse_util.hpp"
 
-#ifndef __THROW
-#if __cplusplus
-#define __THROW noexcept
-#else
-#define __THROW
-#endif
-#endif
+namespace {
 
 extern "C" {
-
-// Both je_nallocx and je_malloc will use the lock je_malloc_mutex_lock_slow,
-// so enabling the jemalloc hook will double the lock usage.
-// In extreme cases this will affect performance, consider turning off mem hook
-// mem hook should avoid nesting new/malloc.
-
-void* doris_malloc(size_t size) __THROW {
-    CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
jenallocx(size, 0); },
-                                               size);
-    void* ptr = jemalloc(size);
-    if (UNLIKELY(ptr == nullptr)) {
-        RELEASE_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
jenallocx(size, 0); },
-                                                   size);
-    }
-    return ptr;
-}
-
-void doris_free(void* p) __THROW {
-    RELEASE_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](void* p) { return 
jemalloc_usable_size(p); }, p);
-    jefree(p);
-}
-
-void* doris_realloc(void* p, size_t size) __THROW {
-    if (UNLIKELY(size == 0)) {
-        return nullptr;
+#define HOOK_MAX 4
+
+enum hook_alloc_e {
+    hook_alloc_malloc,
+    hook_alloc_posix_memalign,
+    hook_alloc_aligned_alloc,
+    hook_alloc_calloc,
+    hook_alloc_memalign,
+    hook_alloc_valloc,
+    hook_alloc_mallocx,
+
+    /* The reallocating functions have both alloc and dalloc variants */
+    hook_alloc_realloc,
+    hook_alloc_rallocx,
+};
+/*
+ * We put the enum typedef after the enum, since this file may get included by
+ * jemalloc_cpp.cpp, and C++ disallows enum forward declarations.
+ */
+using hook_alloc_t = enum hook_alloc_e;
+
+enum hook_dalloc_e {
+    hook_dalloc_free,
+    hook_dalloc_dallocx,
+    hook_dalloc_sdallocx,
+
+    /*
+        * The dalloc halves of reallocation (not called if in-place expansion
+        * happens).
+        */
+    hook_dalloc_realloc,
+    hook_dalloc_rallocx,
+};
+using hook_dalloc_t = enum hook_dalloc_e;
+
+enum hook_expand_e {
+    hook_expand_realloc,
+    hook_expand_rallocx,
+    hook_expand_xallocx,
+};
+using hook_expand_t = enum hook_expand_e;
+
+using hook_alloc = void (*)(void* extra, hook_alloc_t type, void* result, 
uintptr_t result_raw,
+                            uintptr_t args_raw[3]);
+
+using hook_dalloc = void (*)(void* extra, hook_dalloc_t type, void* address, 
uintptr_t args_raw[3]);
+
+using hook_expand = void (*)(void* extra, hook_expand_t type, void* address, 
size_t old_usize,
+                             size_t new_usize, uintptr_t result_raw, uintptr_t 
args_raw[4]);
+
+using hooks_t = struct hooks_s;
+struct hooks_s {
+    hook_alloc alloc_hook;
+    hook_dalloc dalloc_hook;
+    hook_expand expand_hook;
+    void* extra;
+};
+
+void doris_hook_alloc(void* extra, hook_alloc_t type, void* result, uintptr_t 
result_raw,

Review Comment:
   warning: function 'doris_hook_alloc' has cognitive complexity of 76 
(threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   void doris_hook_alloc(void* extra, hook_alloc_t type, void* result, 
uintptr_t result_raw,
        ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/runtime/memory/jemalloc_hook.cpp:86:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (result == nullptr) {
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:89:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       switch (type) {
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:92:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
nallocx(size, 0); },
           ^
   ```
   **be/src/runtime/thread_context.h:433:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
       do {                                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:92:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
nallocx(size, 0); },
           ^
   ```
   **be/src/runtime/thread_context.h:434:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
           if (doris::use_mem_hook) {                                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:92:** nesting level increased to 4
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
nallocx(size, 0); },
                                                      ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:98:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK(size);
           ^
   ```
   **be/src/runtime/thread_context.h:426:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK'
   ```cpp
       do {                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:98:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK(size);
           ^
   ```
   **be/src/runtime/thread_context.h:427:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK'
   ```cpp
           if (doris::use_mem_hook) {                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:99:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
           ^
   ```
   **be/src/runtime/thread_context.h:433:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
       do {                                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:99:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
           ^
   ```
   **be/src/runtime/thread_context.h:434:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
           if (doris::use_mem_hook) {                                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:100:** nesting level increased to 4
   ```cpp
                   [](void* ptr, size_t size) { return malloc_usable_size(ptr) 
- size; }, result,
                   ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:106:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK(size);
           ^
   ```
   **be/src/runtime/thread_context.h:426:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK'
   ```cpp
       do {                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:106:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK(size);
           ^
   ```
   **be/src/runtime/thread_context.h:427:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK'
   ```cpp
           if (doris::use_mem_hook) {                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:107:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
           ^
   ```
   **be/src/runtime/thread_context.h:433:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
       do {                                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:107:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
           ^
   ```
   **be/src/runtime/thread_context.h:434:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
           if (doris::use_mem_hook) {                                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:108:** nesting level increased to 4
   ```cpp
                   [](void* ptr, size_t size) { return malloc_usable_size(ptr) 
- size; }, result,
                   ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:115:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK(num * size);
           ^
   ```
   **be/src/runtime/thread_context.h:426:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK'
   ```cpp
       do {                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:115:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK(num * size);
           ^
   ```
   **be/src/runtime/thread_context.h:427:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK'
   ```cpp
           if (doris::use_mem_hook) {                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:116:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
           ^
   ```
   **be/src/runtime/thread_context.h:433:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
       do {                                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:116:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
           ^
   ```
   **be/src/runtime/thread_context.h:434:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
           if (doris::use_mem_hook) {                                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:117:** nesting level increased to 4
   ```cpp
                   [](void* ptr, size_t size) { return malloc_usable_size(ptr) 
- size; }, result,
                   ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:123:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK(size);
           ^
   ```
   **be/src/runtime/thread_context.h:426:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK'
   ```cpp
       do {                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:123:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK(size);
           ^
   ```
   **be/src/runtime/thread_context.h:427:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK'
   ```cpp
           if (doris::use_mem_hook) {                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:124:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
           ^
   ```
   **be/src/runtime/thread_context.h:433:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
       do {                                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:124:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
           ^
   ```
   **be/src/runtime/thread_context.h:434:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
           if (doris::use_mem_hook) {                                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:125:** nesting level increased to 4
   ```cpp
                   [](void* ptr, size_t size) { return malloc_usable_size(ptr) 
- size; }, result,
                   ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:131:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK(size);
           ^
   ```
   **be/src/runtime/thread_context.h:426:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK'
   ```cpp
       do {                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:131:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK(size);
           ^
   ```
   **be/src/runtime/thread_context.h:427:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK'
   ```cpp
           if (doris::use_mem_hook) {                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:132:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
           ^
   ```
   **be/src/runtime/thread_context.h:433:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
       do {                                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:132:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
           ^
   ```
   **be/src/runtime/thread_context.h:434:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
           if (doris::use_mem_hook) {                                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:133:** nesting level increased to 4
   ```cpp
                   [](void* ptr, size_t size) { return malloc_usable_size(ptr) 
- size; }, result,
                   ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:140:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
nallocx(size, 0); },
           ^
   ```
   **be/src/runtime/thread_context.h:433:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
       do {                                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:140:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
nallocx(size, 0); },
           ^
   ```
   **be/src/runtime/thread_context.h:434:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
           if (doris::use_mem_hook) {                                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:140:** nesting level increased to 4
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
nallocx(size, 0); },
                                                      ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:142:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (flag) {
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:143:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
               ^
   ```
   **be/src/runtime/thread_context.h:433:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
       do {                                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:143:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
               CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN(
               ^
   ```
   **be/src/runtime/thread_context.h:434:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
           if (doris::use_mem_hook) {                                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:144:** nesting level increased to 5
   ```cpp
                       [](void* ptr, size_t size) { return 
malloc_usable_size(ptr) - size; }, result,
                       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:151:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
nallocx(size, 0); },
           ^
   ```
   **be/src/runtime/thread_context.h:433:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
       do {                                                                   \
       ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:151:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
nallocx(size, 0); },
           ^
   ```
   **be/src/runtime/thread_context.h:434:** expanded from macro 
'CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN'
   ```cpp
           if (doris::use_mem_hook) {                                         \
           ^
   ```
   **be/src/runtime/memory/jemalloc_hook.cpp:151:** nesting level increased to 4
   ```cpp
           CONSUME_THREAD_MEM_TRACKER_BY_HOOK_WITH_FN([](size_t size) { return 
nallocx(size, 0); },
                                                      ^
   ```
   
   </details>
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to