smalloc: limit to 1 pool, and bump size to 16MB
[fio.git] / smalloc.c
index 5fe0b6f7e57d11cdade9f103d9e8ff9dd5cbf7c1..67cb7cc11d475b81aef3d53a7eb896eee31504bb 100644 (file)
--- a/smalloc.c
+++ b/smalloc.c
@@ -25,8 +25,8 @@
 #define SMALLOC_BPI    (sizeof(unsigned int) * 8)
 #define SMALLOC_BPL    (SMALLOC_BPB * SMALLOC_BPI)
 
-#define INITIAL_SIZE   8192*1024       /* new pool size */
-#define MAX_POOLS      128             /* maximum number of pools to setup */
+#define INITIAL_SIZE   16*1024*1024    /* new pool size */
+#define MAX_POOLS      1               /* maximum number of pools to setup */
 
 #define SMALLOC_PRE_RED                0xdeadbeefU
 #define SMALLOC_POST_RED       0x5aa55aa5U
@@ -479,6 +479,17 @@ out:
        return NULL;
 }
 
+void *scalloc(size_t nmemb, size_t size)
+{
+       void *ret;
+
+       ret = smalloc(nmemb * size);
+       if (ret)
+               memset(ret, 0, nmemb * size);
+
+       return ret;
+}
+
 char *smalloc_strdup(const char *str)
 {
        char *ptr;