mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
check if malloc_trim() is available
This commit is contained in:
parent
7e2f6757fc
commit
8680c74d1b
2 changed files with 4 additions and 2 deletions
|
|
@ -435,6 +435,7 @@ check_functions = [
|
||||||
['reallocarray', '#include <stdlib.h>', ['-D_GNU_SOURCE'], []],
|
['reallocarray', '#include <stdlib.h>', ['-D_GNU_SOURCE'], []],
|
||||||
['sigabbrev_np', '#include <string.h>', ['-D_GNU_SOURCE'], []],
|
['sigabbrev_np', '#include <string.h>', ['-D_GNU_SOURCE'], []],
|
||||||
['XSetIOErrorExitHandler', '#include <X11/Xlib.h>', [], [x11_dep]],
|
['XSetIOErrorExitHandler', '#include <X11/Xlib.h>', [], [x11_dep]],
|
||||||
|
['malloc_trim', '#include <malloc.h>', [], []],
|
||||||
]
|
]
|
||||||
|
|
||||||
foreach f : check_functions
|
foreach f : check_functions
|
||||||
|
|
|
||||||
|
|
@ -2030,7 +2030,6 @@ void pw_impl_node_destroy(struct pw_impl_node *node)
|
||||||
struct pw_impl_node *follower;
|
struct pw_impl_node *follower;
|
||||||
struct pw_context *context = node->context;
|
struct pw_context *context = node->context;
|
||||||
bool active, had_driver;
|
bool active, had_driver;
|
||||||
int res;
|
|
||||||
|
|
||||||
active = node->active;
|
active = node->active;
|
||||||
node->active = false;
|
node->active = false;
|
||||||
|
|
@ -2106,8 +2105,10 @@ void pw_impl_node_destroy(struct pw_impl_node *node)
|
||||||
spa_system_close(node->data_system, node->source.fd);
|
spa_system_close(node->data_system, node->source.fd);
|
||||||
free(impl);
|
free(impl);
|
||||||
|
|
||||||
res = malloc_trim(0);
|
#ifdef HAVE_MALLOC_TRIM
|
||||||
|
int res = malloc_trim(0);
|
||||||
pw_log_debug("malloc_trim(): %d", res);
|
pw_log_debug("malloc_trim(): %d", res);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue