• Home
  • Raw
  • Download

Lines Matching refs:ranges

17     range_list_t *ranges = (range_list_t *)MALLOC(sizeof(range_list_t));  in init_range_list()  local
19 ranges->array = (range_t *)MALLOC(PARALLEL_ARRAY_SIZE*sizeof(range_t)); in init_range_list()
20 ranges->array_length = PARALLEL_ARRAY_SIZE; in init_range_list()
21 ranges->num_ranges = 0; in init_range_list()
23 ranges->is_sorted = 0; in init_range_list()
25 return ranges; in init_range_list()
28 void destroy_range_list(range_list_t *ranges) { in destroy_range_list() argument
30 for (idx = 0; idx < ranges->num_ranges; idx++) { in destroy_range_list()
31 if (ranges->array[idx].user_dtor) { in destroy_range_list()
32 ASSERT(ranges->array[idx].user); in destroy_range_list()
33 ranges->array[idx].user_dtor(ranges->array[idx].user); in destroy_range_list()
36 FREE(ranges->array); in destroy_range_list()
37 FREE(ranges); in destroy_range_list()
120 range_list_t *ranges, in add_unique_range_nosort() argument
127 if (ranges->num_ranges == ranges->array_length) { in add_unique_range_nosort()
128 ranges->array_length += PARALLEL_ARRAY_SIZE; in add_unique_range_nosort()
129 ranges->array = REALLOC(ranges->array, in add_unique_range_nosort()
130 ranges->array_length*sizeof(range_t)); in add_unique_range_nosort()
132 ranges->array[ranges->num_ranges].start = start; in add_unique_range_nosort()
133 ranges->array[ranges->num_ranges].length = length; in add_unique_range_nosort()
134 ranges->array[ranges->num_ranges].user = user; in add_unique_range_nosort()
135 ranges->array[ranges->num_ranges].err_fn = err_fn; in add_unique_range_nosort()
136 ranges->array[ranges->num_ranges].user_dtor = user_dtor; in add_unique_range_nosort()
137 ranges->num_ranges++; in add_unique_range_nosort()
140 range_list_t *sort_ranges(range_list_t *ranges) { in sort_ranges() argument
141 if (ranges->num_ranges > 1) in sort_ranges()
142 qsort(ranges->array, ranges->num_ranges, sizeof(range_t), range_cmp); in sort_ranges()
143 ranges->is_sorted = 1; in sort_ranges()
144 return ranges; in sort_ranges()
147 range_t *find_range(range_list_t *ranges, GElf_Off value) { in find_range() argument
150 for (i = 0; i < ranges->num_ranges; i++) { in find_range()
151 if (ranges->array[i].start <= value && in find_range()
152 value < ranges->array[i].start + ranges->array[i].length) in find_range()
153 return ranges->array + i; in find_range()
157 ASSERT(ranges->is_sorted); /* The range list must be sorted */ in find_range()
163 ranges->array, ranges->num_ranges, sizeof(range_t), in find_range()
168 int get_num_ranges(const range_list_t *ranges) in get_num_ranges() argument
170 return ranges->num_ranges; in get_num_ranges()
173 range_t *get_sorted_ranges(const range_list_t *ranges, int *num_ranges) { in get_sorted_ranges() argument
174 ASSERT(ranges->is_sorted); /* The range list must be sorted */ in get_sorted_ranges()
176 *num_ranges = ranges->num_ranges; in get_sorted_ranges()
178 return ranges->array; in get_sorted_ranges()
181 GElf_Off get_last_address(const range_list_t *ranges) { in get_last_address() argument
182 ASSERT(ranges->num_ranges); in get_last_address()
184 ranges->array[ranges->num_ranges-1].start + in get_last_address()
185 ranges->array[ranges->num_ranges-1].length; in get_last_address()
212 FREE(info->ranges); in destroy_contiguous_range_info()
232 left_data->ranges[cnt].start, in handle_contiguous_range_error()
233 left_data->ranges[cnt].start + left_data->ranges[cnt].length); in handle_contiguous_range_error()
238 right_data->ranges[cnt].start, in handle_contiguous_range_error()
239 right_data->ranges[cnt].start + right_data->ranges[cnt].length); in handle_contiguous_range_error()
253 range_t *ranges = get_sorted_ranges(input, &num_ranges); in get_contiguous_ranges() local
259 int total_length = ranges[start_idx].length; in get_contiguous_ranges()
261 if (ranges[old_end_idx].start + ranges[old_end_idx].length != in get_contiguous_ranges()
262 ranges[end_idx].start) in get_contiguous_ranges()
265 total_length += ranges[old_end_idx].length; in get_contiguous_ranges()
271 user->ranges = (range_t *)MALLOC(user->num_ranges * sizeof(range_t)); in get_contiguous_ranges()
274 user->ranges[i] = ranges[start_idx + i]; in get_contiguous_ranges()
276 ranges[start_idx].start, in get_contiguous_ranges()