MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / search

Function search

components/mm/avl_adpt.c:71–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71static struct rt_varea *search(struct util_avl_root *root,
72 struct _mm_range range,
73 int (*compare)(void *as, void *ae, void *bs,
74 void *be))
75{
76 struct util_avl_struct *node = root->root_node;
77 while (node)
78 {
79 rt_varea_t varea = VAREA_ENTRY(node);
80 int cmp = compare(range.start, range.end, varea->start,
81 (char *)varea->start + varea->size - 1);
82
83 if (cmp < 0)
84 {
85 node = node->avl_left;
86 }
87 else if (cmp > 0)
88 {
89 node = node->avl_right;
90 }
91 else
92 {
93 return varea;
94 }
95 }
96 return NULL;
97}
98
99struct rt_varea *_aspace_bst_search(struct rt_aspace *aspace, void *key)
100{

Callers 2

_aspace_bst_searchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected