diff --git a/extension/jemalloc/jemalloc/README.md b/extension/jemalloc/jemalloc/README.md index cb93e0680c7..d06a138975e 100644 --- a/extension/jemalloc/jemalloc/README.md +++ b/extension/jemalloc/jemalloc/README.md @@ -166,6 +166,20 @@ static bool os_overcommits_proc(void) ``` +Modify this function to only print in DEBUG mode in `malloc_io.c`. +```c++ +void +malloc_write(const char *s) { +#ifdef DEBUG + if (je_malloc_message != NULL) { + je_malloc_message(NULL, s); + } else { + wrtmessage(NULL, s); + } +#endif +} +``` + Almost no symbols are leaked due to `private_namespace.h`. The `exported_symbols_check.py` script still found a few, so these lines need to be added to `private_namespace.h`: ```c++ diff --git a/extension/jemalloc/jemalloc/src/malloc_io.c b/extension/jemalloc/jemalloc/src/malloc_io.c index 192d82081cc..d067bc8e40b 100644 --- a/extension/jemalloc/jemalloc/src/malloc_io.c +++ b/extension/jemalloc/jemalloc/src/malloc_io.c @@ -79,11 +79,13 @@ JEMALLOC_EXPORT void (*je_malloc_message)(void *, const char *s); */ void malloc_write(const char *s) { +#ifdef DEBUG if (je_malloc_message != NULL) { je_malloc_message(NULL, s); } else { wrtmessage(NULL, s); } +#endif } /*