public inbox for [email protected]
help / color / mirror / Atom feedFrom: John Naylor <[email protected]>
To: [email protected]
Subject: pgsql: Simplify initialization of incremental hash state
Date: Tue, 06 Feb 2024 07:44:43 +0000
Message-ID: <[email protected]> (raw)
Simplify initialization of incremental hash state
The standalone functions fasthash{32,64} use length for two purposes:
how many bytes to hash, and how to perturb the internal seed.
Developers using the incremental interface may not know the length
ahead of time (e.g. for C strings). In this case, it's advised to
pass length to the finalizer, but initialization still needed some
length up front, in the form of a placeholder macro.
Separate the concerns by having the standalone functions perturb the
internal seed themselves from their own length parameter, allowing
to remove "len" from fasthash_init(), as well as the placeholder macro.
Discussion: https://postgr.es/m/CANWCAZbTUk2LOyhsFo33gjLyLAHZ7ucXCi5K9u%3D%2BPtnTShDKtw%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9ed3ee5001b6a2d4cb0166eb8f12a457f30aaca4
Modified Files
--------------
src/backend/catalog/namespace.c | 2 +-
src/include/common/hashfn_unstable.h | 19 ++++++++-----------
2 files changed, 9 insertions(+), 12 deletions(-)
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgsql: Simplify initialization of incremental hash state
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox