Lines Matching refs:nodes

44 static inline ds_priority_queue_node_t *reallocate_nodes(ds_priority_queue_node_t *nodes, uint32_t …  in reallocate_nodes()  argument
46 return erealloc(nodes, capacity * sizeof(ds_priority_queue_node_t)); in reallocate_nodes()
56 queue->nodes = reallocate_nodes(queue->nodes, capacity); in reallocate_to_capacity()
78 queue->nodes = allocate_nodes(DS_PRIORITY_QUEUE_MIN_CAPACITY); in ds_priority_queue()
98 ds_priority_queue_node_t *nodes; in ds_priority_queue_push() local
105 nodes = queue->nodes; in ds_priority_queue_push()
114 if (compare_function(&comparison, priority, &nodes[parent].priority) == SUCCESS) { in ds_priority_queue_push()
123 nodes[index] = nodes[parent]; in ds_priority_queue_push()
126 node = &queue->nodes[index]; in ds_priority_queue_push()
150 ds_priority_queue_node_t *nodes = queue->nodes; in ds_priority_queue_pop() local
164 ZVAL_COPY(return_value, &(nodes[0].value)); in ds_priority_queue_pop()
168 bottom = nodes[size - 1]; in ds_priority_queue_pop()
171 DTOR_AND_UNDEF(&(nodes[0].value)); in ds_priority_queue_pop()
172 DTOR_AND_UNDEF(&(nodes[0].priority)); in ds_priority_queue_pop()
180 … if (swap < queue->size && ds_priority_queue_node_compare(&nodes[swap], &nodes[swap + 1]) < 0) { in ds_priority_queue_pop()
185 if (ds_priority_queue_node_compare(&nodes[swap], &bottom) < 0) { in ds_priority_queue_pop()
189 nodes[index] = nodes[swap]; in ds_priority_queue_pop()
192 nodes[index] = bottom; in ds_priority_queue_pop()
202 ds_priority_queue_node_t *src = queue->nodes; in copy_nodes()
203 ds_priority_queue_node_t *end = queue->nodes + queue->size; in copy_nodes()
218 clone->nodes = copy_nodes(queue); in ds_priority_queue_clone()
233 return &queue->nodes[0].value; in ds_priority_queue_peek()
248 memcpy(buffer, queue->nodes, queue->size * sizeof(ds_priority_queue_node_t)); in ds_priority_queue_create_sorted_buffer()
279 ds_priority_queue_node_t *pos = queue->nodes; in ds_priority_queue_clear()
280 ds_priority_queue_node_t *end = queue->nodes + queue->size; in ds_priority_queue_clear()
295 efree(queue->nodes); in ds_priority_queue_free()