mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pulse-server: add /core message handlers for memory debugging
Add malloc-info and malloc-trim message handlers.
This commit is contained in:
parent
e8f17814ba
commit
4b27807292
2 changed files with 11 additions and 0 deletions
|
|
@ -436,6 +436,7 @@ check_functions = [
|
|||
['sigabbrev_np', '#include <string.h>', ['-D_GNU_SOURCE'], []],
|
||||
['XSetIOErrorExitHandler', '#include <X11/Xlib.h>', [], [x11_dep]],
|
||||
['malloc_trim', '#include <malloc.h>', [], []],
|
||||
['malloc_info', '#include <malloc.h>', [], []],
|
||||
]
|
||||
|
||||
foreach f : check_functions
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#include <regex.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/pod/builder.h>
|
||||
|
|
@ -104,6 +105,15 @@ static int core_object_message_handler(struct client *client, struct pw_manager_
|
|||
}
|
||||
}
|
||||
fputc(']', response);
|
||||
#ifdef HAVE_MALLOC_INFO
|
||||
} else if (spa_streq(message, "malloc-info")) {
|
||||
malloc_info(0, response);
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_TRIM
|
||||
} else if (spa_streq(message, "malloc-trim")) {
|
||||
int res = malloc_trim(0);
|
||||
fprintf(response, "%d", res);
|
||||
#endif
|
||||
} else {
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue