mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-24 08:56:42 -05:00
Make the shared memory segment size configurable
This is useful only on systems where memory overcommit is not available or disabled.
This commit is contained in:
parent
a84b72bf96
commit
79ad4e63f6
23 changed files with 99 additions and 37 deletions
|
|
@ -66,7 +66,7 @@ static int core_process_msg(pa_msgobject *o, int code, void *userdata, int64_t o
|
|||
|
||||
static void core_free(pa_object *o);
|
||||
|
||||
pa_core* pa_core_new(pa_mainloop_api *m, int shared) {
|
||||
pa_core* pa_core_new(pa_mainloop_api *m, pa_bool_t shared, size_t shm_size) {
|
||||
pa_core* c;
|
||||
pa_mempool *pool;
|
||||
int j;
|
||||
|
|
@ -74,14 +74,14 @@ pa_core* pa_core_new(pa_mainloop_api *m, int shared) {
|
|||
pa_assert(m);
|
||||
|
||||
if (shared) {
|
||||
if (!(pool = pa_mempool_new(shared))) {
|
||||
if (!(pool = pa_mempool_new(shared, shm_size))) {
|
||||
pa_log_warn("failed to allocate shared memory pool. Falling back to a normal memory pool.");
|
||||
shared = 0;
|
||||
shared = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shared) {
|
||||
if (!(pool = pa_mempool_new(shared))) {
|
||||
if (!(pool = pa_mempool_new(shared, shm_size))) {
|
||||
pa_log("pa_mempool_new() failed.");
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue