summaryrefslogtreecommitdiff
path: root/src/backend/utils/time/snapmgr.c
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2022-09-20 13:09:30 -0700
committerPeter Geoghegan <pg@bowt.ie>2022-09-20 13:09:30 -0700
commita601366a460f68472bf70c4d94c57baa0a3ed1b2 (patch)
treee2dbfff4d642eab7d34661367ec1b4938033c2a8 /src/backend/utils/time/snapmgr.c
parentc3382a3c3ccda6df126c95bf37dcc762480c5202 (diff)
downloadpostgresql-a601366a460f68472bf70c4d94c57baa0a3ed1b2.tar.gz
Harmonize more parameter names in bulk.
Make sure that function declarations use names that exactly match the corresponding names from function definitions in optimizer, parser, utility, libpq, and "commands" code, as well as in remaining library code. Do the same for all code related to frontend programs (with the exception of pg_dump/pg_dumpall related code). Like other recent commits that cleaned up function parameter names, this commit was written with help from clang-tidy. Later commits will handle ecpg and pg_dump/pg_dumpall. Author: Peter Geoghegan <pg@bowt.ie> Reviewed-By: David Rowley <dgrowleyml@gmail.com> Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
Diffstat (limited to 'src/backend/utils/time/snapmgr.c')
-rw-r--r--src/backend/utils/time/snapmgr.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 9b504c9745..f1f2ddac17 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -680,9 +680,9 @@ FreeSnapshot(Snapshot snapshot)
* with active refcount=1. Otherwise, only increment the refcount.
*/
void
-PushActiveSnapshot(Snapshot snap)
+PushActiveSnapshot(Snapshot snapshot)
{
- PushActiveSnapshotWithLevel(snap, GetCurrentTransactionNestLevel());
+ PushActiveSnapshotWithLevel(snapshot, GetCurrentTransactionNestLevel());
}
/*
@@ -694,11 +694,11 @@ PushActiveSnapshot(Snapshot snap)
* must not be deeper than the current top of the snapshot stack.
*/
void
-PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
+PushActiveSnapshotWithLevel(Snapshot snapshot, int snap_level)
{
ActiveSnapshotElt *newactive;
- Assert(snap != InvalidSnapshot);
+ Assert(snapshot != InvalidSnapshot);
Assert(ActiveSnapshot == NULL || snap_level >= ActiveSnapshot->as_level);
newactive = MemoryContextAlloc(TopTransactionContext, sizeof(ActiveSnapshotElt));
@@ -707,10 +707,11 @@ PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
* Checking SecondarySnapshot is probably useless here, but it seems
* better to be sure.
*/
- if (snap == CurrentSnapshot || snap == SecondarySnapshot || !snap->copied)
- newactive->as_snap = CopySnapshot(snap);
+ if (snapshot == CurrentSnapshot || snapshot == SecondarySnapshot ||
+ !snapshot->copied)
+ newactive->as_snap = CopySnapshot(snapshot);
else
- newactive->as_snap = snap;
+ newactive->as_snap = snapshot;
newactive->as_next = ActiveSnapshot;
newactive->as_level = snap_level;
@@ -2119,20 +2120,20 @@ HistoricSnapshotGetTupleCids(void)
* SerializedSnapshotData.
*/
Size
-EstimateSnapshotSpace(Snapshot snap)
+EstimateSnapshotSpace(Snapshot snapshot)
{
Size size;
- Assert(snap != InvalidSnapshot);
- Assert(snap->snapshot_type == SNAPSHOT_MVCC);
+ Assert(snapshot != InvalidSnapshot);
+ Assert(snapshot->snapshot_type == SNAPSHOT_MVCC);
/* We allocate any XID arrays needed in the same palloc block. */
size = add_size(sizeof(SerializedSnapshotData),
- mul_size(snap->xcnt, sizeof(TransactionId)));
- if (snap->subxcnt > 0 &&
- (!snap->suboverflowed || snap->takenDuringRecovery))
+ mul_size(snapshot->xcnt, sizeof(TransactionId)));
+ if (snapshot->subxcnt > 0 &&
+ (!snapshot->suboverflowed || snapshot->takenDuringRecovery))
size = add_size(size,
- mul_size(snap->subxcnt, sizeof(TransactionId)));
+ mul_size(snapshot->subxcnt, sizeof(TransactionId)));
return size;
}