smalloc: only clear the bitmap, not the whole pool
[fio.git] / smalloc.c
index 8412e7518464d6dbe3e7f218e33e47e855e8e26f..5047cda5e3438c8215a3bb549577f5a81e5b0a29 100644 (file)
--- a/smalloc.c
+++ b/smalloc.c
@@ -213,9 +213,9 @@ static int add_pool(struct pool *pool, unsigned int alloc_size)
        if (ptr == MAP_FAILED)
                goto out_fail;
 
-       memset(ptr, 0, alloc_size);
        pool->map = ptr;
        pool->bitmap = (void *) ptr + (pool->nr_blocks * SMALLOC_BPL);
+       memset(pool->bitmap, 0, bitmap_blocks * sizeof(unsigned int));
 
        pool->lock = fio_mutex_init(FIO_MUTEX_UNLOCKED);
        if (!pool->lock)