Lines Matching refs:branch
25 branch = branch->branches[!!(n)];
35 tree->branch = NULL; in phpdbg_btree_init()
40 phpdbg_btree_branch *branch = tree->branch; in phpdbg_btree_find() local
43 if (branch == NULL) { in phpdbg_btree_find()
49 if (branch->branches[1]) { in phpdbg_btree_find()
55 if (branch->branches[0]) { in phpdbg_btree_find()
63 return &branch->result; in phpdbg_btree_find()
67 phpdbg_btree_branch *branch = tree->branch; in phpdbg_btree_find_closest() local
70 if (branch == NULL) { in phpdbg_btree_find_closest()
77 if (branch->branches[0]) { in phpdbg_btree_find_closest()
87 branch = tree->branch; in phpdbg_btree_find_closest()
91 CHOOSE_BRANCH((idx >> i) % 2 == 1 && branch->branches[1]); in phpdbg_btree_find_closest()
97 CHOOSE_BRANCH(branch->branches[1]); in phpdbg_btree_find_closest()
103 if (branch->branches[1]) { in phpdbg_btree_find_closest()
104 if (branch->branches[0]) { in phpdbg_btree_find_closest()
111 CHOOSE_BRANCH(branch->branches[1]); in phpdbg_btree_find_closest()
118 return &branch->result; in phpdbg_btree_find_closest()
145 phpdbg_btree_branch **branch = &tree->branch; in phpdbg_btree_insert_or_update() local
148 if (*branch == NULL) { in phpdbg_btree_insert_or_update()
151 branch = &(*branch)->branches[(idx >> i) % 2]; in phpdbg_btree_insert_or_update()
154 if (*branch == NULL) { in phpdbg_btree_insert_or_update()
160 phpdbg_btree_branch *memory = *branch = emalloc((i + 2) * sizeof(phpdbg_btree_branch)); in phpdbg_btree_insert_or_update()
162 (*branch)->branches[!((idx >> i) % 2)] = NULL; in phpdbg_btree_insert_or_update()
163 branch = &(*branch)->branches[(idx >> i) % 2]; in phpdbg_btree_insert_or_update()
164 *branch = ++memory; in phpdbg_btree_insert_or_update()
172 (*branch)->result.idx = idx; in phpdbg_btree_insert_or_update()
173 (*branch)->result.ptr = ptr; in phpdbg_btree_insert_or_update()
180 phpdbg_btree_branch *branch = tree->branch; in phpdbg_btree_delete() local
186 if (branch->branches[0] && branch->branches[1]) { in phpdbg_btree_delete()
187 last_dual_branch = branch; in phpdbg_btree_delete()
191 branch = branch->branches[(idx >> i) % 2]; in phpdbg_btree_delete()
194 if (branch == NULL) { in phpdbg_btree_delete()
202 efree(tree->branch); in phpdbg_btree_delete()
203 tree->branch = NULL; in phpdbg_btree_delete()
212 branch = last_dual_branch->branches[!last_dual_branch_branch]; in phpdbg_btree_delete()
214 …branch = (branch->branches[branch->branches[1] == ++original_branch] = last_dual_branch + i_last_d… in phpdbg_btree_delete()
226 void phpdbg_btree_branch_dump(phpdbg_btree_branch *branch, zend_ulong depth) { in phpdbg_btree_branch_dump() argument
227 if (branch) { in phpdbg_btree_branch_dump()
229 phpdbg_btree_branch_dump(branch->branches[0], depth); in phpdbg_btree_branch_dump()
230 phpdbg_btree_branch_dump(branch->branches[1], depth); in phpdbg_btree_branch_dump()
232 fprintf(stderr, "%p: %p\n", (void *) branch->result.idx, branch->result.ptr); in phpdbg_btree_branch_dump()
238 phpdbg_btree_branch_dump(tree->branch, tree->depth); in phpdbg_btree_dump()