Use NULL instead of 0 for 'arg' argument in dshash_create() calls.
authorNathan Bossart <nathan@postgresql.org>
Mon, 26 Feb 2024 21:46:01 +0000 (15:46 -0600)
committerNathan Bossart <nathan@postgresql.org>
Mon, 26 Feb 2024 21:46:01 +0000 (15:46 -0600)
A couple of dshash_create() callers provide 0 for the 'void *arg'
argument, which might give readers the incorrect impression that
this is some sort of "flags" parameter.

Reviewed-by: Andy Fan
Discussion: https://postgr.es/m/20240119215941.GA1322079%40nathanxps13

src/backend/replication/logical/launcher.c
src/backend/utils/activity/pgstat_shmem.c

index 122db0bb1345929d6dc7d974f8e9c9988b355390..ee66c292bd0493a96b32ec53a4b3b90b2925aa4c 100644 (file)
@@ -1013,7 +1013,7 @@ logicalrep_launcher_attach_dshmem(void)
        last_start_times_dsa = dsa_create(LWTRANCHE_LAUNCHER_DSA);
        dsa_pin(last_start_times_dsa);
        dsa_pin_mapping(last_start_times_dsa);
-       last_start_times = dshash_create(last_start_times_dsa, &dsh_params, 0);
+       last_start_times = dshash_create(last_start_times_dsa, &dsh_params, NULL);
 
        /* Store handles in shared memory for other backends to use. */
        LogicalRepCtx->last_start_dsa = dsa_get_handle(last_start_times_dsa);
index 3ce48e88a33f63c51dadbca22dc5d7d980279371..71410ddd3fb94ffec590b227bfc69ea97f9ede2a 100644 (file)
@@ -180,7 +180,7 @@ StatsShmemInit(void)
         * With the limit in place, create the dshash table. XXX: It'd be nice
         * if there were dshash_create_in_place().
         */
-       dsh = dshash_create(dsa, &dsh_params, 0);
+       dsh = dshash_create(dsa, &dsh_params, NULL);
        ctl->hash_handle = dshash_get_hash_table_handle(dsh);
 
        /* lift limit set above */