if zero is passed to pa_memblock_new() allocate largest memory block possible from...
authorLennart Poettering <lennart@poettering.net>
Wed, 14 May 2008 00:40:36 +0000 (00:40 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 14 May 2008 00:40:36 +0000 (00:40 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2412 fefdeb5f-60dc-0310-8127-8f9354f1896f

src/pulsecore/memblock.c

index 33b3874..a555278 100644 (file)
@@ -204,7 +204,9 @@ pa_memblock *pa_memblock_new(pa_mempool *p, size_t length) {
     pa_memblock *b;
 
     pa_assert(p);
-    pa_assert(length > 0);
+
+    if (length <= 0)
+        length = pa_mempool_block_size_max(p);
 
     if (!(b = pa_memblock_new_pool(p, length)))
         b = memblock_new_appended(p, length);