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, Datum d) |
void | binaryheap_build (binaryheap *heap) |
void | binaryheap_add (binaryheap *heap, Datum d) |
Datum | binaryheap_first (binaryheap *heap) |
Datum | binaryheap_remove_first (binaryheap *heap) |
void | binaryheap_replace_first (binaryheap *heap, Datum d) |
void binaryheap_add | ( | binaryheap * | heap, |
Datum | d | ||
) |
Definition at line 141 of file binaryheap.c.
References binaryheap::bh_nodes, binaryheap::bh_size, binaryheap::bh_space, elog, ERROR, and sift_up().
Referenced by pgarch_readyXlog().
void binaryheap_add_unordered | ( | binaryheap * | heap, |
Datum | d | ||
) |
Definition at line 109 of file binaryheap.c.
References binaryheap::bh_has_heap_property, binaryheap::bh_nodes, binaryheap::bh_size, binaryheap::bh_space, elog, and ERROR.
Referenced by BufferSync(), ExecMergeAppend(), gather_merge_init(), pgarch_readyXlog(), and ReorderBufferIterTXNInit().
binaryheap* binaryheap_allocate | ( | int | capacity, |
binaryheap_comparator | compare, | ||
void * | arg | ||
) |
Definition at line 32 of file binaryheap.c.
References arg, binaryheap::bh_arg, binaryheap::bh_compare, binaryheap::bh_has_heap_property, binaryheap::bh_size, binaryheap::bh_space, compare(), offsetof, and palloc().
Referenced by BufferSync(), ExecInitMergeAppend(), gather_merge_setup(), PgArchiverMain(), and ReorderBufferIterTXNInit().
void binaryheap_build | ( | binaryheap * | heap | ) |
Definition at line 125 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(), and ReorderBufferIterTXNInit().
Datum binaryheap_first | ( | binaryheap * | heap | ) |
Definition at line 158 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 68 of file binaryheap.c.
References pfree().
Referenced by BufferSync(), and ReorderBufferIterTXNFinish().
Datum binaryheap_remove_first | ( | binaryheap * | heap | ) |
Definition at line 173 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(), and ReorderBufferIterTXNNext().
void binaryheap_replace_first | ( | binaryheap * | heap, |
Datum | d | ||
) |
Definition at line 207 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 56 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 95 of file binaryheap.c.
References i.
Referenced by binaryheap_build(), and sift_up().
|
inlinestatic |
|
static |
Definition at line 265 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(), and binaryheap_replace_first().
|
static |
Definition at line 222 of file binaryheap.c.
References binaryheap::bh_arg, binaryheap::bh_compare, binaryheap::bh_nodes, cmp(), and parent_offset().
Referenced by binaryheap_add().