pgsql: Simplify hash_xlog_split_allocate_page()

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Simplify hash_xlog_split_allocate_page()
Date: 2025-12-02 08:25:46
Message-ID: E1vQLhh-002Opj-1z@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Simplify hash_xlog_split_allocate_page()

Instead of complicated pointer arithmetic, overlay a uint32 array and
just access the array members. That's safe thanks to
XLogRecGetBlockData() returning a MAXALIGNed buffer.

Reviewed-by: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Reviewed-by: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/aSQy2JawavlVlEB0%40ip-10-97-1-34.eu-west-3.compute.internal

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/35988b31db7767ba446009611b9928add1d40f98

Modified Files
--------------
src/backend/access/hash/hash_xlog.c | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2025-12-02 09:24:21 pgsql: Remove useless casting to same type
Previous Message Peter Eisentraut 2025-12-02 07:44:16 pgsql: Replace pointer comparisons and assignments to literal zero with