projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
graph: fix crash on alias in prio tree
[fio.git]
/
smalloc.c
diff --git
a/smalloc.c
b/smalloc.c
index a925a653e5d5571e9fff8686b7378efe3a343704..5ba20047b37676ec8659dffc53dd6459061a5e4d 100644
(file)
--- a/
smalloc.c
+++ b/
smalloc.c
@@
-8,6
+8,7
@@
#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <string.h>
#include <unistd.h>
+#include <inttypes.h>
#include <sys/types.h>
#include <limits.h>
#include <fcntl.h>
#include <sys/types.h>
#include <limits.h>
#include <fcntl.h>
@@
-171,8
+172,8
@@
static void clear_blocks(struct pool *pool, unsigned int pool_idx,
static int find_next_zero(int word, int start)
{
assert(word != -1U);
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)
}
static int add_pool(struct pool *pool, unsigned int alloc_size)
@@
-253,9
+254,9
@@
void scleanup(void)
#ifdef SMALLOC_REDZONE
static void *postred_ptr(struct block_hdr *hdr)
{
#ifdef SMALLOC_REDZONE
static void *postred_ptr(struct block_hdr *hdr)
{
- u
nsigned long
ptr;
+ u
intptr_t
ptr;
- ptr = (u
nsigned long
) hdr + hdr->size - sizeof(unsigned int);
+ ptr = (u
intptr_t
) hdr + hdr->size - sizeof(unsigned int);
ptr = (ptr + int_mask) & ~int_mask;
return (void *) ptr;
ptr = (ptr + int_mask) & ~int_mask;
return (void *) ptr;