mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05: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
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue