Lines Matching refs:array
35 void **array; /* array[0] is not used */ member
51 heap->array = xnmalloc (n_reserve, sizeof *(heap->array)); in heap_alloc()
53 heap->array[0] = nullptr; in heap_alloc()
72 free (heap->array); in heap_free()
82 heap->array = x2nrealloc (heap->array, &heap->capacity, in heap_insert()
83 sizeof *(heap->array)); in heap_insert()
85 heap->array[++heap->count] = item; in heap_insert()
86 heapify_up (heap->array, heap->count, heap->compare); in heap_insert()
101 top = heap->array[1]; in heap_remove_top()
102 heap->array[1] = heap->array[heap->count--]; in heap_remove_top()
103 heapify_down (heap->array, heap->count, 1, heap->compare); in heap_remove_top()
111 heapify_down (void **array, size_t count, size_t initial, in heapify_down() argument
114 void *element = array[initial]; in heapify_down()
121 if (child < count && compare (array[child], array[child + 1]) < 0) in heapify_down()
124 if (compare (array[child], element) <= 0) in heapify_down()
127 array[parent] = array[child]; in heapify_down()
131 array[parent] = element; in heapify_down()
138 heapify_up (void **array, size_t count, in heapify_up() argument
142 void *new_element = array[k]; in heapify_up()
144 while (k != 1 && compare (array[k / 2], new_element) <= 0) in heapify_up()
146 array[k] = array[k / 2]; in heapify_up()
150 array[k] = new_element; in heapify_up()