Skip to content

Commit

Permalink
silence jemalloc in non-debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Sep 5, 2024
1 parent ef6037e commit 2f4d618
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions extension/jemalloc/jemalloc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down
2 changes: 2 additions & 0 deletions extension/jemalloc/jemalloc/src/malloc_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/*
Expand Down

0 comments on commit 2f4d618

Please sign in to comment.