From e2899f8bf331d4cc89e2fa4ef3d17924fb91f922 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 17 Sep 2009 01:21:56 +0200 Subject: [PATCH] memblock: make it easy to disable mempool usage with $PULSE_MEMPOOL_DISABLE --- src/pulsecore/memblock.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c index 0e40d12..47f298a 100644 --- a/src/pulsecore/memblock.c +++ b/src/pulsecore/memblock.c @@ -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 *b = NULL; struct mempool_slot *slot; + static int mempool_disable = 0; pa_assert(p); 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 * take the largest size that fits in one of our slots. */ -- 2.7.4