mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-19 16:01:45 +00:00
pulse-server: limit the max cache to 16MB
Don't recycle messages when we have too many allocated already. See #1840
This commit is contained in:
parent
8995129e6c
commit
418c6fbe96
|
@ -39,6 +39,8 @@
|
|||
#include "message.h"
|
||||
#include "volume.h"
|
||||
|
||||
#define MAX_ALLOCATED (16*1024 *1024)
|
||||
|
||||
#define VOLUME_MUTED ((uint32_t) 0U)
|
||||
#define VOLUME_NORM ((uint32_t) 0x10000U)
|
||||
#define VOLUME_MAX ((uint32_t) UINT32_MAX/2)
|
||||
|
@ -859,6 +861,9 @@ void message_free(struct impl *impl, struct message *msg, bool dequeue, bool des
|
|||
if (dequeue)
|
||||
spa_list_remove(&msg->link);
|
||||
|
||||
if (msg->stat->allocated > MAX_ALLOCATED)
|
||||
destroy = true;
|
||||
|
||||
if (destroy) {
|
||||
pw_log_trace("destroy message %p", msg);
|
||||
msg->stat->n_allocated--;
|
||||
|
|
Loading…
Reference in a new issue