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) |
Typedefs | |
typedef int(* | binaryheap_comparator) (Datum a, Datum 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, 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) |
#define binaryheap_empty | ( | h | ) | ((h)->bh_size == 0) |
Definition at line 52 of file binaryheap.h.
typedef struct binaryheap binaryheap |
Definition at line 18 of file binaryheap.h.
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(), 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().