Lines Matching refs:tree
33 void phpdbg_btree_init(phpdbg_btree *tree, zend_ulong depth) { in phpdbg_btree_init() argument
34 tree->depth = depth; in phpdbg_btree_init()
35 tree->branch = NULL; in phpdbg_btree_init()
36 tree->persistent = 0; in phpdbg_btree_init()
37 tree->count = 0; in phpdbg_btree_init()
40 phpdbg_btree_result *phpdbg_btree_find(phpdbg_btree *tree, zend_ulong idx) { in phpdbg_btree_find() argument
41 phpdbg_btree_branch *branch = tree->branch; in phpdbg_btree_find()
42 int i = tree->depth - 1; in phpdbg_btree_find()
67 phpdbg_btree_result *phpdbg_btree_find_closest(phpdbg_btree *tree, zend_ulong idx) { in phpdbg_btree_find_closest() argument
68 phpdbg_btree_branch *branch = tree->branch; in phpdbg_btree_find_closest()
69 int i = tree->depth - 1, last_superior_i = -1; in phpdbg_btree_find_closest()
88 branch = tree->branch; in phpdbg_btree_find_closest()
89 i = tree->depth - 1; in phpdbg_btree_find_closest()
122 phpdbg_btree_position phpdbg_btree_find_between(phpdbg_btree *tree, zend_ulong lower_idx, zend_ulon… in phpdbg_btree_find_between() argument
125 pos.tree = tree; in phpdbg_btree_find_between()
133 phpdbg_btree_result *result = phpdbg_btree_find_closest(pos->tree, pos->cur); in phpdbg_btree_next()
144 int phpdbg_btree_insert_or_update(phpdbg_btree *tree, zend_ulong idx, void *ptr, int flags) { in phpdbg_btree_insert_or_update() argument
145 int i = tree->depth - 1; in phpdbg_btree_insert_or_update()
146 phpdbg_btree_branch **branch = &tree->branch; in phpdbg_btree_insert_or_update()
161 …phpdbg_btree_branch *memory = *branch = pemalloc((i + 2) * sizeof(phpdbg_btree_branch), tree->pers… in phpdbg_btree_insert_or_update()
167 tree->count++; in phpdbg_btree_insert_or_update()
179 int phpdbg_btree_delete(phpdbg_btree *tree, zend_ulong idx) { in phpdbg_btree_delete() argument
180 int i = tree->depth; in phpdbg_btree_delete()
181 phpdbg_btree_branch *branch = tree->branch; in phpdbg_btree_delete()
200 tree->count--; in phpdbg_btree_delete()
203 pefree(tree->branch, tree->persistent); in phpdbg_btree_delete()
204 tree->branch = NULL; in phpdbg_btree_delete()
210 pefree(last_dual_branch->branches[!last_dual_branch_branch], tree->persistent); in phpdbg_btree_delete()
218 pefree(last_dual_branch->branches[last_dual_branch_branch], tree->persistent); in phpdbg_btree_delete()
239 void phpdbg_btree_clean(phpdbg_btree *tree) { in phpdbg_btree_clean() argument
240 if (tree->branch) { in phpdbg_btree_clean()
241 phpdbg_btree_clean_recursive(tree->branch, tree->depth, tree->persistent); in phpdbg_btree_clean()
242 tree->branch = NULL; in phpdbg_btree_clean()
243 tree->count = 0; in phpdbg_btree_clean()
258 void phpdbg_btree_dump(phpdbg_btree *tree) { in phpdbg_btree_dump() argument
259 phpdbg_btree_branch_dump(tree->branch, tree->depth); in phpdbg_btree_dump()