smalloc: increase initial pool size from 64k to 1m
[fio.git] / smalloc.c
index e6f89b2dd94824f6fe0432825c625d9d00c44ffd..fd0e9bd05fe81e1a91750933ca4f405937dd3a8a 100644 (file)
--- a/smalloc.c
+++ b/smalloc.c
@@ -16,7 +16,7 @@
 #undef ENABLE_RESIZE           /* define to enable pool resizing */
 #define MP_SAFE                        /* define to made allocator thread safe */
 
-#define INITIAL_SIZE   65536   /* new pool size */
+#define INITIAL_SIZE   1048576 /* new pool size */
 #define MAX_POOLS      32      /* maximum number of pools to setup */
 
 #ifdef ENABLE_RESIZE
@@ -268,11 +268,12 @@ out_close:
 
 void sinit(void)
 {
-       int ret = add_pool(&mp[0]);
+       int ret;
 
 #ifdef MP_SAFE
-       lock = fio_mutex_init(1);
+       lock = fio_mutex_rw_init();
 #endif
+       ret = add_pool(&mp[0]);
        assert(!ret);
 }
 
@@ -363,7 +364,7 @@ restart:
        do {
                if (combine(pool, prv, hdr))
                        hdr = prv;
-                       
+
                if (hdr_free(hdr) && hdr_size(hdr) >= size)
                        break;