]> git.ipfire.org Git - thirdparty/postgresql.git/commit
btree_gist: Fix memory allocation formula
authorMichael Paquier <michael@paquier.xyz>
Thu, 18 Dec 2025 02:01:43 +0000 (11:01 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 18 Dec 2025 02:01:43 +0000 (11:01 +0900)
commit5cf03552fbb43b2d2d11369d779f9b168ea9b87a
tree37d85c6c95ff889af669728d9203fa98477abf0d
parent167cb26718e3eae4fef470900b4cd1d434f15649
btree_gist: Fix memory allocation formula

This change has been suggested by the two authors listed in this commit,
both of them providing an incomplete solution (David's formula relied on
a "bytea *", while Bertrand's did not use palloc_array()).  The solution
provided in this commit uses GBT_VARKEY instead of the inconsistent
bytea for the allocation size, with a palloc_array().

The change related to Vsrt is one I am flipping to a more consistent
style, in passing.

Author: David Geier <geidav.pg@gmail.com>
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/ad0748d4-3080-436e-b0bc-ac8f86a3466a@gmail.com
Discussion: https://postgr.es/m/aTrG3Fi4APtfiCvQ@ip-10-97-1-34.eu-west-3.compute.internal
contrib/btree_gist/btree_utils_var.c