40#define MAX_TREE_HEIGHT 64
42#define ELEMENT_KEY(tree, element) \
43 (tree->offset_to_key ? (void *)((uchar *)element + tree->offset_to_key) \
44 : *((void **)(element + 1)))
46#define tree_set_pointer(element, ptr) \
47 *((uchar **)(element + 1)) = ((uchar *)(ptr))
65#define ELEMENT_CHILD(element, offs) \
66 (*(TREE_ELEMENT **)((char *)element + offs))
82void init_tree(
TREE *tree, ulong memory_limit,
int element_size,
89#define is_tree_inited(tree) ((tree)->root != 0)
93 const void *custom_arg);
100 const void *custom_arg);
107 const void *custom_arg);
109#define TREE_ELEMENT_EXTRA_SIZE (sizeof(TREE_ELEMENT) + sizeof(void *))
int(* qsort2_cmp)(const void *, const void *, const void *)
Definition: my_sys.h:468
static int flag
Definition: hp_test1.cc:40
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
This file includes constants used by all storage engines.
ha_rkey_function
Definition: my_base.h:78
my_off_t ha_rows
Definition: my_base.h:1140
Some integer typedefs for easier portability.
uint32_t uint32
Definition: my_inttypes.h:67
Common header for many mysys elements.
TREE_WALK
Definition: my_tree.h:51
@ right_root_left
Definition: my_tree.h:51
@ left_root_right
Definition: my_tree.h:51
void * tree_search_next(TREE *tree, TREE_ELEMENT ***last_pos, int l_offs, int r_offs)
Definition: tree.cc:420
void init_tree(TREE *tree, ulong memory_limit, int element_size, qsort2_cmp compare, bool with_delete, tree_element_free free_element, const void *custom_arg)
Definition: tree.cc:104
void * tree_search_edge(TREE *tree, TREE_ELEMENT **parents, TREE_ELEMENT ***last_pos, int child_offs)
Definition: tree.cc:406
void * tree_search_key(TREE *tree, const void *key, TREE_ELEMENT **parents, TREE_ELEMENT ***last_pos, enum ha_rkey_function flag, const void *custom_arg)
Definition: tree.cc:332
int tree_walk(TREE *tree, tree_walk_action action, void *argument, TREE_WALK visit)
Definition: tree.cc:488
TREE_ELEMENT * tree_insert(TREE *tree, void *key, uint key_size, const void *custom_arg)
Definition: tree.cc:201
ha_rows tree_record_pos(TREE *tree, const void *key, enum ha_rkey_function search_flag, const void *custom_arg)
Definition: tree.cc:446
void reset_tree(TREE *)
Definition: tree.cc:174
int tree_delete(TREE *tree, void *key, uint key_size, const void *custom_arg)
Definition: tree.cc:264
void delete_tree(TREE *)
Definition: tree.cc:170
int(* tree_walk_action)(void *, element_count, void *)
Definition: my_tree.h:53
#define MAX_TREE_HEIGHT
Definition: my_tree.h:40
void * tree_search(TREE *tree, void *key, const void *custom_arg)
Definition: tree.cc:316
uint32 element_count
Definition: my_tree.h:52
void(* tree_element_free)(void *, TREE_FREE, const void *)
Definition: my_tree.h:56
TREE_FREE
Definition: my_tree.h:55
@ free_init
Definition: my_tree.h:55
@ free_free
Definition: my_tree.h:55
@ free_end
Definition: my_tree.h:55
required string key
Definition: replication_asynchronous_connection_failover.proto:60
repeated Action action
Definition: replication_group_member_actions.proto:43
static int compare(size_t a, size_t b)
Function to compare two size_t integers for their relative order.
Definition: rpl_utility.cc:107
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
uint32 colour
Definition: my_tree.h:62
TREE_ELEMENT * right
Definition: my_tree.h:61
TREE_ELEMENT()
Definition: my_tree.h:59
uint32 count
Definition: my_tree.h:62
TREE_ELEMENT * left
Definition: my_tree.h:61
TREE_ELEMENT * root
Definition: my_tree.h:69
TREE_ELEMENT null_element
Definition: my_tree.h:69
TREE_ELEMENT ** parents[MAX_TREE_HEIGHT]
Definition: my_tree.h:70
tree_element_free free
Definition: my_tree.h:77
uint flag
Definition: my_tree.h:78
qsort2_cmp compare
Definition: my_tree.h:73
uint elements_in_tree
Definition: my_tree.h:71
ulong memory_limit
Definition: my_tree.h:72
bool with_delete
Definition: my_tree.h:76
uint offset_to_key
Definition: my_tree.h:71
uint size_of_element
Definition: my_tree.h:71
ulong allocated
Definition: my_tree.h:72
const void * custom_arg
Definition: my_tree.h:74
MEM_ROOT mem_root
Definition: my_tree.h:75
unsigned int uint
Definition: uca9-dump.cc:75