smalloc: use optimized ffz()
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/smalloc.c b/smalloc.c
index 6cbf59c..0a86c43 100644
--- a/smalloc.c
+++ b/smalloc.c
@@ -12,7 +12,7 @@
#include <limits.h>
#include "mutex.h"
-#include "lib/ffz.h"
+#include "arch/arch.h"
#define MP_SAFE /* define to make thread safe */
#define SMALLOC_REDZONE /* define to detect memory corruption */
@@ -178,7 +178,7 @@
{
assert(word != -1U);
word >>= (start + 1);
- return __ffs(~word) + start + 1;
+ return ffz(word) + start + 1;
}
static int add_pool(struct pool *pool, unsigned int alloc_size)