Lines Matching refs:sorted
76 static void __name##_sorted__insert(struct __name##_sorted *sorted, \
79 struct rb_node **p = &sorted->entries.rb_node, *parent = NULL; \
88 rb_insert_color(sorted_nd, &sorted->entries); \
91 static void __name##_sorted__sort(struct __name##_sorted *sorted, \
97 struct __name##_sorted_entry *snd = &sorted->nd[i++]; \
99 __name##_sorted__insert(sorted, &snd->rb_node); \
106 struct __name##_sorted *sorted; \
107 sorted = malloc(sizeof(*sorted) + sizeof(sorted->nd[0]) * nr_entries); \
108 if (sorted) { \
109 sorted->entries = RB_ROOT; \
110 __name##_sorted__sort(sorted, entries); \
112 return sorted; \
115 static void __name##_sorted__delete(struct __name##_sorted *sorted) \
117 free(sorted); \