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) |
static void | swap_nodes (binaryheap *heap, int a, int b) |
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 142 of file binaryheap.c.
References binaryheap::bh_nodes, binaryheap::bh_size, binaryheap::bh_space, elog, ERROR, and sift_up().
void binaryheap_add_unordered | ( | binaryheap * | heap, |
Datum | d | ||
) |
Definition at line 110 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(), and ReorderBufferIterTXNInit().
binaryheap* binaryheap_allocate | ( | int | capacity, |
binaryheap_comparator | compare, | ||
void * | arg | ||
) |
Definition at line 33 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(), and ReorderBufferIterTXNInit().
void binaryheap_build | ( | binaryheap * | heap | ) |
Definition at line 126 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(), and ReorderBufferIterTXNInit().
Datum binaryheap_first | ( | binaryheap * | heap | ) |
Definition at line 159 of file binaryheap.c.
References Assert, binaryheap::bh_has_heap_property, binaryheap::bh_nodes, and binaryheap_empty.
Referenced by BufferSync(), ExecMergeAppend(), gather_merge_getnext(), and ReorderBufferIterTXNNext().
void binaryheap_free | ( | binaryheap * | heap | ) |
Definition at line 69 of file binaryheap.c.
References pfree().
Referenced by BufferSync(), and ReorderBufferIterTXNFinish().
Datum binaryheap_remove_first | ( | binaryheap * | heap | ) |
Definition at line 174 of file binaryheap.c.
References Assert, binaryheap::bh_has_heap_property, binaryheap::bh_nodes, binaryheap::bh_size, binaryheap_empty, sift_down(), and swap_nodes().
Referenced by BufferSync(), ExecMergeAppend(), gather_merge_getnext(), and ReorderBufferIterTXNNext().
void binaryheap_replace_first | ( | binaryheap * | heap, |
Datum | d | ||
) |
Definition at line 204 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 57 of file binaryheap.c.
References binaryheap::bh_has_heap_property, and binaryheap::bh_size.
Referenced by ExecReScanMergeAppend(), and gather_merge_init().
|
inlinestatic |
Definition at line 84 of file binaryheap.c.
Referenced by sift_down().
|
inlinestatic |
Definition at line 96 of file binaryheap.c.
Referenced by binaryheap_build(), and sift_up().
|
inlinestatic |
Definition at line 90 of file binaryheap.c.
Referenced by sift_down().
|
static |
Definition at line 264 of file binaryheap.c.
References binaryheap::bh_arg, binaryheap::bh_compare, binaryheap::bh_nodes, left_offset(), right_offset(), and swap_nodes().
Referenced by binaryheap_build(), binaryheap_remove_first(), and binaryheap_replace_first().
|
static |
Definition at line 232 of file binaryheap.c.
References binaryheap::bh_arg, binaryheap::bh_compare, binaryheap::bh_nodes, cmp(), parent_offset(), and swap_nodes().
Referenced by binaryheap_add().
|
inlinestatic |
Definition at line 218 of file binaryheap.c.
References binaryheap::bh_nodes.
Referenced by binaryheap_remove_first(), sift_down(), and sift_up().