summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-09-17 01:21:56 +0200
committerLennart Poettering <lennart@poettering.net>2009-09-17 01:21:56 +0200
commite2899f8bf331d4cc89e2fa4ef3d17924fb91f922 (patch)
tree688ee38386a0b46da6f956d0800829e2d269b008
parent6b8fdc41693a710a29c4d3851a8c870031f1af88 (diff)
memblock: make it easy to disable mempool usage with $PULSE_MEMPOOL_DISABLE
-rw-r--r--src/pulsecore/memblock.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c
index 0e40d12b..47f298a4 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. */