mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	memblock: make it easy to disable mempool usage with $PULSE_MEMPOOL_DISABLE
This commit is contained in:
		
							parent
							
								
									6b8fdc4169
								
							
						
					
					
						commit
						e2899f8bf3
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
					@ -303,10 +303,17 @@ static struct mempool_slot* mempool_slot_by_ptr(pa_mempool *p, void *ptr) {
 | 
				
			||||||
pa_memblock *pa_memblock_new_pool(pa_mempool *p, size_t length) {
 | 
					pa_memblock *pa_memblock_new_pool(pa_mempool *p, size_t length) {
 | 
				
			||||||
    pa_memblock *b = NULL;
 | 
					    pa_memblock *b = NULL;
 | 
				
			||||||
    struct mempool_slot *slot;
 | 
					    struct mempool_slot *slot;
 | 
				
			||||||
 | 
					    static int mempool_disable = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_assert(p);
 | 
					    pa_assert(p);
 | 
				
			||||||
    pa_assert(length);
 | 
					    pa_assert(length);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (mempool_disable == 0)
 | 
				
			||||||
 | 
					        mempool_disable = getenv("PULSE_MEMPOOL_DISABLE") ? 1 : -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (mempool_disable > 0)
 | 
				
			||||||
 | 
					        return NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* If -1 is passed as length we choose the size for the caller: we
 | 
					    /* If -1 is passed as length we choose the size for the caller: we
 | 
				
			||||||
     * take the largest size that fits in one of our slots. */
 | 
					     * take the largest size that fits in one of our slots. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue