Makefile: break long line
[fio.git] / smalloc.c
index 0c7c6df7bdd17992a5fa3c8acb6b53a769621009..d0b6f1e1f0059fb266aac3334d078f36715fbacd 100644 (file)
--- a/smalloc.c
+++ b/smalloc.c
@@ -8,6 +8,7 @@
 #include <assert.h>
 #include <string.h>
 #include <unistd.h>
+#include <inttypes.h>
 #include <sys/types.h>
 #include <limits.h>
 #include <fcntl.h>
@@ -205,7 +206,7 @@ static int add_pool(struct pool *pool, unsigned int alloc_size)
        pool->map = ptr;
        pool->bitmap = (void *) ptr + (pool->nr_blocks * SMALLOC_BPL);
 
-       pool->lock = fio_mutex_init(1);
+       pool->lock = fio_mutex_init(FIO_MUTEX_UNLOCKED);
        if (!pool->lock)
                goto out_fail;
 
@@ -253,9 +254,9 @@ void scleanup(void)
 #ifdef SMALLOC_REDZONE
 static void *postred_ptr(struct block_hdr *hdr)
 {
-       unsigned long ptr;
+       uintptr_t ptr;
 
-       ptr = (unsigned long) hdr + hdr->size - sizeof(unsigned int);
+       ptr = (uintptr_t) hdr + hdr->size - sizeof(unsigned int);
        ptr = (ptr + int_mask) & ~int_mask;
 
        return (void *) ptr;