Lines Matching refs:tree
35 void phpdbg_btree_init(phpdbg_btree *tree, zend_ulong depth) { in phpdbg_btree_init() argument
36 tree->depth = depth; in phpdbg_btree_init()
37 tree->branch = NULL; in phpdbg_btree_init()
38 tree->persistent = 0; in phpdbg_btree_init()
39 tree->count = 0; in phpdbg_btree_init()
42 phpdbg_btree_result *phpdbg_btree_find(phpdbg_btree *tree, zend_ulong idx) { in phpdbg_btree_find() argument
43 phpdbg_btree_branch *branch = tree->branch; in phpdbg_btree_find()
44 int i = tree->depth - 1; in phpdbg_btree_find()
69 phpdbg_btree_result *phpdbg_btree_find_closest(phpdbg_btree *tree, zend_ulong idx) { in phpdbg_btree_find_closest() argument
70 phpdbg_btree_branch *branch = tree->branch; in phpdbg_btree_find_closest()
71 int i = tree->depth - 1, last_superior_i = -1; in phpdbg_btree_find_closest()
90 branch = tree->branch; in phpdbg_btree_find_closest()
91 i = tree->depth - 1; in phpdbg_btree_find_closest()
124 phpdbg_btree_position phpdbg_btree_find_between(phpdbg_btree *tree, zend_ulong lower_idx, zend_ulon… in phpdbg_btree_find_between() argument
127 pos.tree = tree; in phpdbg_btree_find_between()
135 phpdbg_btree_result *result = phpdbg_btree_find_closest(pos->tree, pos->cur); in phpdbg_btree_next()
146 int phpdbg_btree_insert_or_update(phpdbg_btree *tree, zend_ulong idx, void *ptr, int flags) { in phpdbg_btree_insert_or_update() argument
147 int i = tree->depth - 1; in phpdbg_btree_insert_or_update()
148 phpdbg_btree_branch **branch = &tree->branch; in phpdbg_btree_insert_or_update()
163 …phpdbg_btree_branch *memory = *branch = pemalloc((i + 2) * sizeof(phpdbg_btree_branch), tree->pers… in phpdbg_btree_insert_or_update()
169 tree->count++; in phpdbg_btree_insert_or_update()
181 int phpdbg_btree_delete(phpdbg_btree *tree, zend_ulong idx) { in phpdbg_btree_delete() argument
182 int i = tree->depth; in phpdbg_btree_delete()
183 phpdbg_btree_branch *branch = tree->branch; in phpdbg_btree_delete()
202 tree->count--; in phpdbg_btree_delete()
205 pefree(tree->branch, tree->persistent); in phpdbg_btree_delete()
206 tree->branch = NULL; in phpdbg_btree_delete()
212 pefree(last_dual_branch->branches[!last_dual_branch_branch], tree->persistent); in phpdbg_btree_delete()
220 pefree(last_dual_branch->branches[last_dual_branch_branch], tree->persistent); in phpdbg_btree_delete()
241 void phpdbg_btree_clean(phpdbg_btree *tree) { in phpdbg_btree_clean() argument
242 if (tree->branch) { in phpdbg_btree_clean()
243 phpdbg_btree_clean_recursive(tree->branch, tree->depth, tree->persistent); in phpdbg_btree_clean()
244 tree->branch = NULL; in phpdbg_btree_clean()
245 tree->count = 0; in phpdbg_btree_clean()
260 void phpdbg_btree_dump(phpdbg_btree *tree) { in phpdbg_btree_dump() argument
261 phpdbg_btree_branch_dump(tree->branch, tree->depth); in phpdbg_btree_dump()