Simplify hash_xlog_split_allocate_page()
authorPeter Eisentraut <peter@eisentraut.org>
Tue, 2 Dec 2025 08:10:02 +0000 (09:10 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Tue, 2 Dec 2025 08:18:54 +0000 (09:18 +0100)
commit35988b31db7767ba446009611b9928add1d40f98
treef5ba4c83eb5ce5b11ebfbb3e87f50180701b7fc5
parentec782f56b0c30ef493e8356b46e1131612f01d9f
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.pg@gmail.com>
Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/aSQy2JawavlVlEB0%40ip-10-97-1-34.eu-west-3.compute.internal
src/backend/access/hash/hash_xlog.c