Skip to content

Commit be2085c

Browse files
author
Commitfest Bot
committed
[CF 5798] v1 - a couple of small cleanup patches for DSM-related code
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5798 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/aECi_gSD9JnVWQ8T@nathan Author(s): Nathan Bossart
2 parents c37be39 + 78b3190 commit be2085c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/backend/replication/logical/launcher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ logicalrep_launcher_attach_dshmem(void)
10161016
last_start_times_dsa = dsa_attach(LogicalRepCtx->last_start_dsa);
10171017
dsa_pin_mapping(last_start_times_dsa);
10181018
last_start_times = dshash_attach(last_start_times_dsa, &dsh_params,
1019-
LogicalRepCtx->last_start_dsh, 0);
1019+
LogicalRepCtx->last_start_dsh, NULL);
10201020
}
10211021

10221022
MemoryContextSwitchTo(oldcontext);

src/backend/utils/activity/pgstat_shmem.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ StatsShmemInit(void)
183183
p += MAXALIGN(pgstat_dsa_init_size());
184184
dsa = dsa_create_in_place(ctl->raw_dsa_area,
185185
pgstat_dsa_init_size(),
186-
LWTRANCHE_PGSTATS_DSA, 0);
186+
LWTRANCHE_PGSTATS_DSA, NULL);
187187
dsa_pin(dsa);
188188

189189
/*
@@ -255,7 +255,8 @@ pgstat_attach_shmem(void)
255255
dsa_pin_mapping(pgStatLocal.dsa);
256256

257257
pgStatLocal.shared_hash = dshash_attach(pgStatLocal.dsa, &dsh_params,
258-
pgStatLocal.shmem->hash_handle, 0);
258+
pgStatLocal.shmem->hash_handle,
259+
NULL);
259260

260261
MemoryContextSwitchTo(oldcontext);
261262
}

src/test/modules/test_dsm_registry/test_dsm_registry.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ set_val_in_shmem(PG_FUNCTION_ARGS)
5454
tdr_attach_shmem();
5555

5656
LWLockAcquire(&tdr_state->lck, LW_EXCLUSIVE);
57-
tdr_state->val = PG_GETARG_UINT32(0);
57+
tdr_state->val = PG_GETARG_INT32(0);
5858
LWLockRelease(&tdr_state->lck);
5959

6060
PG_RETURN_VOID();
@@ -72,5 +72,5 @@ get_val_in_shmem(PG_FUNCTION_ARGS)
7272
ret = tdr_state->val;
7373
LWLockRelease(&tdr_state->lck);
7474

75-
PG_RETURN_UINT32(ret);
75+
PG_RETURN_INT32(ret);
7676
}

0 commit comments

Comments
 (0)