|
PostgreSQL Source Code git master
|

Go to the source code of this file.
Data Structures | |
| struct | binaryheap |
Macros | |
| #define | binaryheap_empty(h) ((h)->bh_size == 0) |
| #define | binaryheap_size(h) ((h)->bh_size) |
| #define | binaryheap_get_node(h, n) ((h)->bh_nodes[n]) |
Typedefs | |
| typedef Datum | bh_node_type |
| typedef int(* | binaryheap_comparator) (bh_node_type a, bh_node_type b, void *arg) |
| typedef struct binaryheap | binaryheap |
Functions | |
| binaryheap * | binaryheap_allocate (int capacity, binaryheap_comparator compare, void *arg) |
| void | binaryheap_reset (binaryheap *heap) |
| void | binaryheap_free (binaryheap *heap) |
| 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) |
| #define binaryheap_empty | ( | h | ) | ((h)->bh_size == 0) |
Definition at line 65 of file binaryheap.h.
| #define binaryheap_get_node | ( | h, | |
| n | |||
| ) | ((h)->bh_nodes[n]) |
Definition at line 67 of file binaryheap.h.
| #define binaryheap_size | ( | h | ) | ((h)->bh_size) |
Definition at line 66 of file binaryheap.h.
| typedef Datum bh_node_type |
Definition at line 23 of file binaryheap.h.
| typedef struct binaryheap binaryheap |
| typedef int(* binaryheap_comparator) (bh_node_type a, bh_node_type b, void *arg) |
Definition at line 30 of file binaryheap.h.
| 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(), test_basic(), test_duplicates(), test_remove_node(), test_replace_first(), test_reset(), 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(), test_build(), 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(), test_basic(), test_build(), test_duplicates(), test_remove_node(), test_replace_first(), test_reset(), 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(), test_build(), 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(), ReorderBufferIterTXNNext(), and test_basic().
| 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(), test_basic(), test_duplicates(), 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(), and test_remove_node().
| 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(), ReorderBufferIterTXNNext(), and test_replace_first().
| 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(), pgarch_readyXlog(), and test_reset().