pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: btree_gist: Fix memory allocation formula
Date: Thu, 18 Dec 2025 02:16:14 +0000
Message-ID: <E1vW3Yr-001L37-1y@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5cf03552fbb43b2d2d11369d779f9b168ea9b87a

Modified Files
--------------
contrib/btree_gist/btree_utils_var.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



Message-ID: <E1vW3Yr-001L37-1y@gemulon.postgresql.org>
Permalink:  ../E1vW3Yr-001L37-1y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vW3Yr-001L37-1y@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: btree_gist: Fix memory allocation formula
  In-Reply-To: <E1vW3Yr-001L37-1y@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox