Lines Matching refs:rtree
13 rtree_new(rtree_t *rtree, unsigned bits, rtree_node_alloc_t *alloc, in rtree_new() argument
30 rtree->alloc = alloc; in rtree_new()
31 rtree->dalloc = dalloc; in rtree_new()
32 rtree->height = height; in rtree_new()
35 rtree->levels[0].subtree = NULL; in rtree_new()
36 rtree->levels[0].bits = (height > 1) ? RTREE_BITS_PER_LEVEL : in rtree_new()
38 rtree->levels[0].cumbits = rtree->levels[0].bits; in rtree_new()
41 rtree->levels[i].subtree = NULL; in rtree_new()
42 rtree->levels[i].bits = RTREE_BITS_PER_LEVEL; in rtree_new()
43 rtree->levels[i].cumbits = rtree->levels[i-1].cumbits + in rtree_new()
48 rtree->levels[height-1].subtree = NULL; in rtree_new()
49 rtree->levels[height-1].bits = bits_in_leaf; in rtree_new()
50 rtree->levels[height-1].cumbits = bits; in rtree_new()
55 rtree->start_level[i] = hmin(RTREE_HEIGHT_MAX - 1 - i, height - in rtree_new()
63 rtree_delete_subtree(rtree_t *rtree, rtree_node_elm_t *node, unsigned level) in rtree_delete_subtree() argument
66 if (level + 1 < rtree->height) { in rtree_delete_subtree()
69 nchildren = ZU(1) << rtree->levels[level].bits; in rtree_delete_subtree()
73 rtree_delete_subtree(rtree, child, level + 1); in rtree_delete_subtree()
76 rtree->dalloc(node); in rtree_delete_subtree()
80 rtree_delete(rtree_t *rtree) in rtree_delete() argument
84 for (i = 0; i < rtree->height; i++) { in rtree_delete()
85 rtree_node_elm_t *subtree = rtree->levels[i].subtree; in rtree_delete()
87 rtree_delete_subtree(rtree, subtree, i); in rtree_delete()
92 rtree_node_init(rtree_t *rtree, unsigned level, rtree_node_elm_t **elmp) in rtree_node_init() argument
106 node = rtree->alloc(ZU(1) << rtree->levels[level].bits); in rtree_node_init()
116 rtree_subtree_read_hard(rtree_t *rtree, unsigned level) in rtree_subtree_read_hard() argument
119 return (rtree_node_init(rtree, level, &rtree->levels[level].subtree)); in rtree_subtree_read_hard()
123 rtree_child_read_hard(rtree_t *rtree, rtree_node_elm_t *elm, unsigned level) in rtree_child_read_hard() argument
126 return (rtree_node_init(rtree, level, &elm->child)); in rtree_child_read_hard()