Fix comments for the dshash_parameters struct.
authorNathan Bossart <nathan@postgresql.org>
Tue, 27 Feb 2024 15:44:59 +0000 (09:44 -0600)
committerNathan Bossart <nathan@postgresql.org>
Tue, 27 Feb 2024 15:44:59 +0000 (09:44 -0600)
A recent commit added a copy_function member to the
dshash_parameters struct, but it missed updating a couple of
comments that refer to the function pointer members of this struct.
One of those comments also refers to a tranche_name member and non-
arg variants of the function pointer members, all of which were
either removed during development or removed shortly after dshash
table support was committed.

Oversights in commits 8c0d7bafadd7694fc148, and 42a1de3013.

Discussion: https://postgr.es/m/20240227045213.GA2329190%40nathanxps13

src/backend/lib/dshash.c
src/include/lib/dshash.h

index cc49b4ca51300d265e15c35f6a52f342fc439c9b..ab30f29eee0029aa3dba114ae1e48a18948139dd 100644 (file)
@@ -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)
index 2ff1ba6c24dec1ee669f61ec8f292500e420b166..7dda269b7535e80042e519eaa63e2a79934706b5 100644 (file)
@@ -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 member 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
 {