memblock: use built-in function
authorLu Guanqun <guanqun.lu@intel.com>
Mon, 15 Aug 2011 05:24:51 +0000 (13:24 +0800)
committerColin Guthrie <colin@mageia.org>
Mon, 15 Aug 2011 08:41:56 +0000 (09:41 +0100)
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
src/pulsecore/memblock.c

index 19be151..9739731 100644 (file)
@@ -229,7 +229,7 @@ static pa_memblock *memblock_new_appended(pa_mempool *p, size_t length) {
     /* If -1 is passed as length we choose the size for the caller. */
 
     if (length == (size_t) -1)
-        length = p->block_size - PA_ALIGN(sizeof(pa_memblock));
+        length = pa_mempool_block_size_max(p);
 
     b = pa_xmalloc(PA_ALIGN(sizeof(pa_memblock)) + length);
     PA_REFCNT_INIT(b);