On Mon, Feb 26, 2024 at 03:55:10PM -0600, Nathan Bossart wrote: > Committed.
I noticed that I forgot to update a couple of comments. While fixing those, I discovered additional oversights that have been around since 2017. I plan to commit this shortly. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
>From 298b98552f7e5586a268de9aeaec533631a9f608 Mon Sep 17 00:00:00 2001 From: Nathan Bossart <nat...@postgresql.org> Date: Mon, 26 Feb 2024 22:33:41 -0600 Subject: [PATCH 1/1] Fix comments for the dshash_parameters struct. I recently added a copy_function member to the dshash_parameters struct, but I forgot to update a couple of comments that refer to the function pointer members of this struct. While fixing that, I noticed that one comment refers to a tranche_name member that was removed during development of dshash tables. The same comment also refers to non-arg variants of the function pointer members, but those were removed shortly after dshash table support was first committed. Oversights in commits 8c0d7bafad, d7694fc148, and 42a1de3013. --- src/backend/lib/dshash.c | 2 +- src/include/lib/dshash.h | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/backend/lib/dshash.c b/src/backend/lib/dshash.c index cc49b4ca51..ab30f29eee 100644 --- a/src/backend/lib/dshash.c +++ b/src/backend/lib/dshash.c @@ -202,7 +202,7 @@ static inline void copy_key(dshash_table *hash_table, void *dest, * Create a new hash table backed by the given dynamic shared area, with the * given parameters. The returned object is allocated in backend-local memory * using the current MemoryContext. 'arg' will be passed through to the - * compare and hash functions. + * compare, hash, and copy functions. */ dshash_table * dshash_create(dsa_area *area, const dshash_parameters *params, void *arg) diff --git a/src/include/lib/dshash.h b/src/include/lib/dshash.h index 2ff1ba6c24..e26f3ef97f 100644 --- a/src/include/lib/dshash.h +++ b/src/include/lib/dshash.h @@ -43,15 +43,13 @@ typedef void (*dshash_copy_function) (void *dest, const void *src, size_t size, /* * The set of parameters needed to create or attach to a hash table. The - * members tranche_id and tranche_name do not need to be initialized when - * attaching to an existing hash table. + * tranche_id does not need to be initialized when attaching to an existing + * hash table. * - * Compare and hash functions must be supplied even when attaching, because we - * can't safely share function pointers between backends in general. Either - * the arg variants or the non-arg variants should be supplied; the other - * function pointers should be NULL. If the arg variants are supplied then the - * user data pointer supplied to the create and attach functions will be - * passed to the hash and compare functions. + * Compare, hash, and copy functions must be supplied even when attaching, + * because we can't safely share function pointers between backends in general. + * The user data pointer supplied to the create and attach functions will be + * passed to these functions. */ typedef struct dshash_parameters { -- 2.25.1