1234370Sjasone#define JEMALLOC_EXTENT_C_ 2234370Sjasone#include "jemalloc/internal/jemalloc_internal.h" 3234370Sjasone 4234370Sjasone/******************************************************************************/ 5234370Sjasone 6234370Sjasonestatic inline int 7234370Sjasoneextent_szad_comp(extent_node_t *a, extent_node_t *b) 8234370Sjasone{ 9234370Sjasone int ret; 10234370Sjasone size_t a_size = a->size; 11234370Sjasone size_t b_size = b->size; 12234370Sjasone 13234370Sjasone ret = (a_size > b_size) - (a_size < b_size); 14234370Sjasone if (ret == 0) { 15234370Sjasone uintptr_t a_addr = (uintptr_t)a->addr; 16234370Sjasone uintptr_t b_addr = (uintptr_t)b->addr; 17234370Sjasone 18234370Sjasone ret = (a_addr > b_addr) - (a_addr < b_addr); 19234370Sjasone } 20234370Sjasone 21234370Sjasone return (ret); 22234370Sjasone} 23234370Sjasone 24234370Sjasone/* Generate red-black tree functions. */ 25234370Sjasonerb_gen(, extent_tree_szad_, extent_tree_t, extent_node_t, link_szad, 26234370Sjasone extent_szad_comp) 27234370Sjasone 28234370Sjasonestatic inline int 29234370Sjasoneextent_ad_comp(extent_node_t *a, extent_node_t *b) 30234370Sjasone{ 31234370Sjasone uintptr_t a_addr = (uintptr_t)a->addr; 32234370Sjasone uintptr_t b_addr = (uintptr_t)b->addr; 33234370Sjasone 34234370Sjasone return ((a_addr > b_addr) - (a_addr < b_addr)); 35234370Sjasone} 36234370Sjasone 37234370Sjasone/* Generate red-black tree functions. */ 38234370Sjasonerb_gen(, extent_tree_ad_, extent_tree_t, extent_node_t, link_ad, 39234370Sjasone extent_ad_comp) 40