Home
last modified time | relevance | path

Searched refs:tree (Results 1 – 9 of 9) sorted by last modified time

/unit/src/
H A Dnxt_mp.c158 static nxt_mp_block_t *nxt_mp_find_block(nxt_rbtree_t *tree, const u_char *p);
833 nxt_mp_find_block(nxt_rbtree_t *tree, const u_char *p) in nxt_mp_find_block() argument
838 node = nxt_rbtree_root(tree); in nxt_mp_find_block()
839 sentinel = nxt_rbtree_sentinel(tree); in nxt_mp_find_block()
H A Dnxt_timer.c235 nxt_rbtree_t *tree; in nxt_timer_find() local
244 tree = &timers->tree; in nxt_timer_find()
246 for (node = nxt_rbtree_min(tree); in nxt_timer_find()
247 nxt_rbtree_is_there_successor(tree, node); in nxt_timer_find()
250 next = nxt_rbtree_node_successor(tree, node); in nxt_timer_find()
285 nxt_rbtree_t *tree; in nxt_timer_expire() local
299 tree = &timers->tree; in nxt_timer_expire()
301 for (node = nxt_rbtree_min(tree); in nxt_timer_expire()
302 nxt_rbtree_is_there_successor(tree, node); in nxt_timer_expire()
312 next = nxt_rbtree_node_successor(tree, node); in nxt_timer_expire()
[all …]
H A Dnxt_timer.h63 nxt_rbtree_t tree; member
H A Dnxt_rbtree.h52 ((tree)->sentinel.left)
56 (&(tree)->sentinel)
60 (nxt_rbtree_root(tree) == nxt_rbtree_sentinel(tree))
64 nxt_rbtree_branch_min(tree, &(tree)->sentinel)
68 nxt_rbtree_branch_min(nxt_rbtree_t *tree, nxt_rbtree_node_t *node) in nxt_rbtree_branch_min() argument
70 while (node->left != nxt_rbtree_sentinel(tree)) { in nxt_rbtree_branch_min()
79 ((node) != nxt_rbtree_sentinel(tree))
87 if (node->right != nxt_rbtree_sentinel(tree)) { in nxt_rbtree_node_successor()
88 return nxt_rbtree_branch_min(tree, node->right); in nxt_rbtree_node_successor()
107 NXT_EXPORT void nxt_rbtree_init(nxt_rbtree_t *tree,
[all …]
H A Dnxt_rbtree.c46 tree->sentinel.left = &tree->sentinel; in nxt_rbtree_init()
52 tree->sentinel.right = (void *) compare; in nxt_rbtree_init()
67 node = nxt_rbtree_root(tree); in nxt_rbtree_insert()
68 sentinel = nxt_rbtree_sentinel(tree); in nxt_rbtree_insert()
75 child = &nxt_rbtree_root(tree); in nxt_rbtree_insert()
91 node = nxt_rbtree_root(tree); in nxt_rbtree_insert()
188 next = nxt_rbtree_root(tree); in nxt_rbtree_find()
189 sentinel = nxt_rbtree_sentinel(tree); in nxt_rbtree_find()
223 next = nxt_rbtree_root(tree); in nxt_rbtree_find_less_or_equal()
224 sentinel = nxt_rbtree_sentinel(tree); in nxt_rbtree_find_less_or_equal()
[all …]
/unit/src/test/
H A Dnxt_rbtree1_test.c13 (((tree)->root) == (tree)->sentinel)
17 ((node) != (tree)->sentinel)
25 if (node->right != tree->sentinel) { in nxt_rbtree1_node_successor()
33 return tree->sentinel; in nxt_rbtree1_node_successor()
61 nxt_rbtree1_t tree; in nxt_rbtree1_test() local
96 nxt_rbtree1_insert(&tree, &nodes[i]); in nxt_rbtree1_test()
108 node = nxt_rbtree1_min(tree.root, tree.sentinel); in nxt_rbtree1_test()
128 nxt_rbtree1_delete(&tree, &nodes[i]); in nxt_rbtree1_test()
135 if (!nxt_rbtree1_is_empty(&tree)) { in nxt_rbtree1_test()
231 next = tree->root; in nxt_rbtree1_test_find()
[all …]
H A Dnxt_rbtree1.h36 #define nxt_rbtree1_init(tree, s, i) \ argument
38 (tree)->root = s; \
39 (tree)->sentinel = s; \
40 (tree)->insert = i
43 NXT_EXPORT void nxt_rbtree1_insert(nxt_rbtree1_t *tree,
45 NXT_EXPORT void nxt_rbtree1_delete(nxt_rbtree1_t *tree,
H A Dnxt_rbtree1.c25 nxt_rbtree1_insert(nxt_rbtree1_t *tree, nxt_rbtree1_node_t *node) in nxt_rbtree1_insert() argument
31 root = (nxt_rbtree1_node_t **) &tree->root; in nxt_rbtree1_insert()
32 sentinel = tree->sentinel; in nxt_rbtree1_insert()
44 tree->insert(*root, node, sentinel); in nxt_rbtree1_insert()
157 nxt_rbtree1_delete(nxt_rbtree1_t *tree, nxt_rbtree1_node_t *node) in nxt_rbtree1_delete() argument
164 root = (nxt_rbtree1_node_t **) &tree->root; in nxt_rbtree1_delete()
165 sentinel = tree->sentinel; in nxt_rbtree1_delete()
H A Dnxt_rbtree_test.c30 nxt_rbtree_t tree; in nxt_rbtree_test() local
38 nxt_rbtree_init(&tree, nxt_rbtree_test_comparison); in nxt_rbtree_test()
40 mark = tree.sentinel.right; in nxt_rbtree_test()
68 nxt_rbtree_insert(&tree, &items[i].node); in nxt_rbtree_test()
72 node = nxt_rbtree_find(&tree, &items[i].node); in nxt_rbtree_test()
82 node = nxt_rbtree_min(&tree); in nxt_rbtree_test()
84 while (nxt_rbtree_is_there_successor(&tree, node)) { in nxt_rbtree_test()
95 node = nxt_rbtree_node_successor(&tree, node); in nxt_rbtree_test()
104 nxt_rbtree_delete(&tree, &items[i].node); in nxt_rbtree_test()
111 if (!nxt_rbtree_is_empty(&tree)) { in nxt_rbtree_test()
[all …]