aboutsummaryrefslogtreecommitdiff
path: root/src/include/lib/binaryheap.h
diff options
context:
space:
mode:
authorMasahiko Sawada <msawada@postgresql.org>2024-04-03 10:27:43 +0900
committerMasahiko Sawada <msawada@postgresql.org>2024-04-03 10:27:43 +0900
commitbcb14f4abca0c309f908b3f0cd64378785c99795 (patch)
tree2b756a9431bf00d9cb819c825609935e99fafbe1 /src/include/lib/binaryheap.h
parent2c91e13013414cf77bb8026a19a926e08f4e9e7a (diff)
downloadpostgresql-bcb14f4abca0c309f908b3f0cd64378785c99795.tar.gz
postgresql-bcb14f4abca0c309f908b3f0cd64378785c99795.zip
Make binaryheap enlargeable.
The node array space of the binaryheap is doubled when there is no available space. Reviewed-by: Vignesh C, Peter Smith, Hayato Kuroda, Ajin Cherian, Tomas Vondra, Shubham Khanna Discussion: https://postgr.es/m/CAD21AoDffo37RC-eUuyHJKVEr017V2YYDLyn1xF_00ofptWbkg%40mail.gmail.com
Diffstat (limited to 'src/include/lib/binaryheap.h')
-rw-r--r--src/include/lib/binaryheap.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/lib/binaryheap.h b/src/include/lib/binaryheap.h
index 19025c08ef1..9f6efb06e3a 100644
--- a/src/include/lib/binaryheap.h
+++ b/src/include/lib/binaryheap.h
@@ -46,10 +46,10 @@ typedef struct binaryheap
bool bh_has_heap_property; /* debugging cross-check */
binaryheap_comparator bh_compare;
void *bh_arg;
- bh_node_type bh_nodes[FLEXIBLE_ARRAY_MEMBER];
+ bh_node_type *bh_nodes;
} binaryheap;
-extern binaryheap *binaryheap_allocate(int capacity,
+extern binaryheap *binaryheap_allocate(int num_nodes,
binaryheap_comparator compare,
void *arg);
extern void binaryheap_reset(binaryheap *heap);