PostgreSQL Source Code
git master
|
Go to the source code of this file.
Functions | |
static void | sift_down (binaryheap *heap, int node_off) |
static void | sift_up (binaryheap *heap, int node_off) |
binaryheap * | binaryheap_allocate (int capacity, binaryheap_comparator compare, void *arg) |
void | binaryheap_reset (binaryheap *heap) |
void | binaryheap_free (binaryheap *heap) |
static int | left_offset (int i) |
static int | right_offset (int i) |
static int | parent_offset (int i) |
void | binaryheap_add_unordered (binaryheap *heap, bh_node_type d) |
void | binaryheap_build (binaryheap *heap) |
void | binaryheap_add (binaryheap *heap, bh_node_type d) |
bh_node_type | binaryheap_first (binaryheap *heap) |
bh_node_type | binaryheap_remove_first (binaryheap *heap) |
void | binaryheap_remove_node (binaryheap *heap, int n) |
void | binaryheap_replace_first (binaryheap *heap, bh_node_type d) |
void binaryheap_add | ( | binaryheap * | heap, |
bh_node_type | d | ||
) |
Definition at line 154 of file binaryheap.c.
References binaryheap::bh_nodes, binaryheap::bh_size, binaryheap::bh_space, elog, ERROR, pg_fatal, and sift_up().
Referenced by move_to_ready_heap(), pgarch_readyXlog(), reduce_dependencies(), and TopoSort().
void binaryheap_add_unordered | ( | binaryheap * | heap, |
bh_node_type | d | ||
) |
Definition at line 116 of file binaryheap.c.
References binaryheap::bh_has_heap_property, binaryheap::bh_nodes, binaryheap::bh_size, binaryheap::bh_space, elog, ERROR, and pg_fatal.
Referenced by BufferSync(), ExecMergeAppend(), gather_merge_init(), pgarch_readyXlog(), ReorderBufferIterTXNInit(), and TopoSort().
binaryheap* binaryheap_allocate | ( | int | capacity, |
binaryheap_comparator | compare, | ||
void * | arg | ||
) |
Definition at line 39 of file binaryheap.c.
References arg, binaryheap::bh_arg, binaryheap::bh_compare, binaryheap::bh_has_heap_property, binaryheap::bh_size, binaryheap::bh_space, compare(), and palloc().
Referenced by BufferSync(), ExecInitMergeAppend(), gather_merge_setup(), PgArchiverMain(), ReorderBufferIterTXNInit(), restore_toc_entries_parallel(), and TopoSort().
void binaryheap_build | ( | binaryheap * | heap | ) |
Definition at line 138 of file binaryheap.c.
References binaryheap::bh_has_heap_property, binaryheap::bh_size, i, parent_offset(), and sift_down().
Referenced by BufferSync(), ExecMergeAppend(), gather_merge_init(), pgarch_readyXlog(), ReorderBufferIterTXNInit(), and TopoSort().
bh_node_type binaryheap_first | ( | binaryheap * | heap | ) |
Definition at line 177 of file binaryheap.c.
References Assert, binaryheap::bh_has_heap_property, binaryheap::bh_nodes, and binaryheap_empty.
Referenced by BufferSync(), ExecMergeAppend(), gather_merge_getnext(), pgarch_readyXlog(), and ReorderBufferIterTXNNext().
void binaryheap_free | ( | binaryheap * | heap | ) |
Definition at line 75 of file binaryheap.c.
References pfree().
Referenced by BufferSync(), ReorderBufferIterTXNFinish(), restore_toc_entries_parallel(), and TopoSort().
bh_node_type binaryheap_remove_first | ( | binaryheap * | heap | ) |
Definition at line 192 of file binaryheap.c.
References Assert, binaryheap::bh_has_heap_property, binaryheap::bh_nodes, binaryheap::bh_size, binaryheap_empty, and sift_down().
Referenced by BufferSync(), ExecMergeAppend(), gather_merge_getnext(), pgarch_readyXlog(), ReorderBufferIterTXNNext(), and TopoSort().
void binaryheap_remove_node | ( | binaryheap * | heap, |
int | n | ||
) |
Definition at line 225 of file binaryheap.c.
References Assert, binaryheap::bh_arg, binaryheap::bh_compare, binaryheap::bh_has_heap_property, binaryheap::bh_nodes, binaryheap::bh_size, binaryheap_empty, cmp(), sift_down(), and sift_up().
Referenced by pop_next_work_item().
void binaryheap_replace_first | ( | binaryheap * | heap, |
bh_node_type | d | ||
) |
Definition at line 255 of file binaryheap.c.
References Assert, binaryheap::bh_has_heap_property, binaryheap::bh_nodes, binaryheap::bh_size, binaryheap_empty, and sift_down().
Referenced by BufferSync(), ExecMergeAppend(), gather_merge_getnext(), and ReorderBufferIterTXNNext().
void binaryheap_reset | ( | binaryheap * | heap | ) |
Definition at line 63 of file binaryheap.c.
References binaryheap::bh_has_heap_property, and binaryheap::bh_size.
Referenced by ExecReScanMergeAppend(), gather_merge_init(), and pgarch_readyXlog().
|
inlinestatic |
|
inlinestatic |
Definition at line 102 of file binaryheap.c.
References i.
Referenced by binaryheap_build(), and sift_up().
|
inlinestatic |
|
static |
Definition at line 313 of file binaryheap.c.
References binaryheap::bh_arg, binaryheap::bh_compare, binaryheap::bh_nodes, left_offset(), and right_offset().
Referenced by binaryheap_build(), binaryheap_remove_first(), binaryheap_remove_node(), and binaryheap_replace_first().
|
static |
Definition at line 270 of file binaryheap.c.
References binaryheap::bh_arg, binaryheap::bh_compare, binaryheap::bh_nodes, cmp(), and parent_offset().
Referenced by binaryheap_add(), and binaryheap_remove_node().