Add sparc and sparc64 support
[fio.git] / smalloc.c
index dfddfba9fcc0eef0246af80b566fec0d8171c97f..6cbf59cf320a0eb0fcf1bf9166f6b581bfe0c983 100644 (file)
--- a/smalloc.c
+++ b/smalloc.c
@@ -12,6 +12,7 @@
 #include <limits.h>
 
 #include "mutex.h"
+#include "lib/ffz.h"
 
 #define MP_SAFE                        /* define to make thread safe */
 #define SMALLOC_REDZONE                /* define to detect memory corruption */
@@ -173,34 +174,6 @@ static void clear_blocks(struct pool *pool, unsigned int pool_idx,
        blocks_iter(pool, pool_idx, idx, nr_blocks, mask_clear);
 }
 
-static inline int __ffs(int word)
-{
-       int r = 0;
-
-       if (!(word & 0xffff)) {
-               word >>= 16;
-               r += 16;
-       }
-       if (!(word & 0xff)) {
-               word >>= 8;
-               r += 8;
-       }
-       if (!(word & 0xf)) {
-               word >>= 4;
-               r += 4;
-       }
-       if (!(word & 3)) {
-               word >>= 2;
-               r += 2;
-       }
-       if (!(word & 1)) {
-               word >>= 1;
-               r += 1;
-       }
-
-       return r;
-}
-
 static int find_next_zero(int word, int start)
 {
        assert(word != -1U);