]>
git.saurik.com Git - redis.git/blob - deps/jemalloc/src/extent.c
1 #define JEMALLOC_EXTENT_C_
2 #include "jemalloc/internal/jemalloc_internal.h"
4 /******************************************************************************/
6 #if (defined(JEMALLOC_SWAP) || defined(JEMALLOC_DSS))
8 extent_szad_comp(extent_node_t
*a
, extent_node_t
*b
)
11 size_t a_size
= a
->size
;
12 size_t b_size
= b
->size
;
14 ret
= (a_size
> b_size
) - (a_size
< b_size
);
16 uintptr_t a_addr
= (uintptr_t)a
->addr
;
17 uintptr_t b_addr
= (uintptr_t)b
->addr
;
19 ret
= (a_addr
> b_addr
) - (a_addr
< b_addr
);
25 /* Generate red-black tree functions. */
26 rb_gen(, extent_tree_szad_
, extent_tree_t
, extent_node_t
, link_szad
,
31 extent_ad_comp(extent_node_t
*a
, extent_node_t
*b
)
33 uintptr_t a_addr
= (uintptr_t)a
->addr
;
34 uintptr_t b_addr
= (uintptr_t)b
->addr
;
36 return ((a_addr
> b_addr
) - (a_addr
< b_addr
));
39 /* Generate red-black tree functions. */
40 rb_gen(, extent_tree_ad_
, extent_tree_t
, extent_node_t
, link_ad
,