Skip to content

Commit e1724af

Browse files
Fix comments for the dshash_parameters struct.
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 8c0d7ba, d7694fc, and 42a1de3. Discussion: https://postgr.es/m/20240227045213.GA2329190%40nathanxps13
1 parent 92d2ab7 commit e1724af

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/backend/lib/dshash.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ static inline void copy_key(dshash_table *hash_table, void *dest,
202202
* Create a new hash table backed by the given dynamic shared area, with the
203203
* given parameters. The returned object is allocated in backend-local memory
204204
* using the current MemoryContext. 'arg' will be passed through to the
205-
* compare and hash functions.
205+
* compare, hash, and copy functions.
206206
*/
207207
dshash_table *
208208
dshash_create(dsa_area *area, const dshash_parameters *params, void *arg)

src/include/lib/dshash.h

+6-8
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,13 @@ typedef void (*dshash_copy_function) (void *dest, const void *src, size_t size,
4343

4444
/*
4545
* The set of parameters needed to create or attach to a hash table. The
46-
* members tranche_id and tranche_name do not need to be initialized when
47-
* attaching to an existing hash table.
46+
* tranche_id member does not need to be initialized when attaching to an
47+
* existing hash table.
4848
*
49-
* Compare and hash functions must be supplied even when attaching, because we
50-
* can't safely share function pointers between backends in general. Either
51-
* the arg variants or the non-arg variants should be supplied; the other
52-
* function pointers should be NULL. If the arg variants are supplied then the
53-
* user data pointer supplied to the create and attach functions will be
54-
* passed to the hash and compare functions.
49+
* Compare, hash, and copy functions must be supplied even when attaching,
50+
* because we can't safely share function pointers between backends in general.
51+
* The user data pointer supplied to the create and attach functions will be
52+
* passed to these functions.
5553
*/
5654
typedef struct dshash_parameters
5755
{

0 commit comments

Comments
 (0)