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
71 if (branch == NULL) { in phpdbg_btree_find_closest()
78 if (!had_alternative_branch && (idx >> i) % 2 == 0 && !branch->branches[0]) { in phpdbg_btree_find_closest()
85 branch = tree->branch; in phpdbg_btree_find_closest()
89 CHOOSE_BRANCH((idx >> i) % 2 == 1 && branch->branches[1]); in phpdbg_btree_find_closest()
95 CHOOSE_BRANCH(branch->branches[1]); in phpdbg_btree_find_closest()
101 if (branch->branches[1]) { in phpdbg_btree_find_closest()
102 if (branch->branches[0]) { in phpdbg_btree_find_closest()
115 return &branch->result; in phpdbg_btree_find_closest()
142 phpdbg_btree_branch **branch = &tree->branch; in phpdbg_btree_insert_or_update() local
145 if (*branch == NULL) { in phpdbg_btree_insert_or_update()
148 branch = &(*branch)->branches[(idx >> i) % 2]; in phpdbg_btree_insert_or_update()
151 if (*branch == NULL) { in phpdbg_btree_insert_or_update()
157 phpdbg_btree_branch *memory = *branch = emalloc((i + 2) * sizeof(phpdbg_btree_branch)); in phpdbg_btree_insert_or_update()
159 (*branch)->branches[!((idx >> i) % 2)] = NULL; in phpdbg_btree_insert_or_update()
160 branch = &(*branch)->branches[(idx >> i) % 2]; in phpdbg_btree_insert_or_update()
161 *branch = ++memory; in phpdbg_btree_insert_or_update()
169 (*branch)->result.idx = idx; in phpdbg_btree_insert_or_update()
170 (*branch)->result.ptr = ptr; in phpdbg_btree_insert_or_update()
177 phpdbg_btree_branch *branch = tree->branch; in phpdbg_btree_delete() local
183 if (branch->branches[0] && branch->branches[1]) { in phpdbg_btree_delete()
184 last_dual_branch = branch; in phpdbg_btree_delete()
188 branch = branch->branches[(idx >> i) % 2]; in phpdbg_btree_delete()
191 if (branch == NULL) { in phpdbg_btree_delete()
199 efree(tree->branch); in phpdbg_btree_delete()
200 tree->branch = NULL; in phpdbg_btree_delete()
209 branch = last_dual_branch->branches[!last_dual_branch_branch]; in phpdbg_btree_delete()
211branch = (branch->branches[branch->branches[1] == ++original_branch] = last_dual_branch + i_last_d… in phpdbg_btree_delete()