#include <assert.h>
#include <string.h>
#include <unistd.h>
+#include <inttypes.h>
#include <sys/types.h>
#include <limits.h>
#include <fcntl.h>
static int find_next_zero(int word, int start)
{
assert(word != -1U);
- word >>= (start + 1);
- return ffz(word) + start + 1;
+ word >>= start;
+ return ffz(word) + start;
}
static int add_pool(struct pool *pool, unsigned int alloc_size)
#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;