aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-03-25 16:08:03 +0900
committerMichael Paquier <michael@paquier.xyz>2021-03-25 16:08:03 +0900
commita1999a01bb56c5f5451116abe61b892b2eec5e49 (patch)
tree1df99c815f9d6f7057748b841bf4297d6f6a5329 /src/backend/utils
parent438fc4a39c3905b7af88bb848bc5aeb1308a017d (diff)
downloadpostgresql-a1999a01bb56c5f5451116abe61b892b2eec5e49.tar.gz
postgresql-a1999a01bb56c5f5451116abe61b892b2eec5e49.zip
Sanitize the term "combo CID" in code comments
Combo CIDs were referred in the code comments using different terms across various places of the code, so unify a bit the term used with what is currently in use in some of the READMEs. Author: "Hou, Zhijie" Discussion: https://postgr.es/m/1d42865c91404f46af4562532fdbea31@G08CNEXMBPEKD05.g08.fujitsu.local
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/time/combocid.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/backend/utils/time/combocid.c b/src/backend/utils/time/combocid.c
index 6d67d38f252..44fe2f3dbe1 100644
--- a/src/backend/utils/time/combocid.c
+++ b/src/backend/utils/time/combocid.c
@@ -14,8 +14,8 @@
* real cmin and cmax using a backend-private array, which is managed by
* this module.
*
- * To allow reusing existing combo cids, we also keep a hash table that
- * maps cmin,cmax pairs to combo cids. This keeps the data structure size
+ * To allow reusing existing combo CIDs, we also keep a hash table that
+ * maps cmin,cmax pairs to combo CIDs. This keeps the data structure size
* reasonable in most cases, since the number of unique pairs used by any
* one transaction is likely to be small.
*
@@ -49,7 +49,7 @@
#include "utils/hsearch.h"
#include "utils/memutils.h"
-/* Hash table to lookup combo cids by cmin and cmax */
+/* Hash table to lookup combo CIDs by cmin and cmax */
static HTAB *comboHash = NULL;
/* Key and entry structures for the hash table */
@@ -75,7 +75,7 @@ typedef ComboCidEntryData *ComboCidEntry;
/*
* An array of cmin,cmax pairs, indexed by combo command id.
- * To convert a combo cid to cmin and cmax, you do a simple array lookup.
+ * To convert a combo CID to cmin and cmax, you do a simple array lookup.
*/
static ComboCidKey comboCids = NULL;
static int usedComboCids = 0; /* number of elements in comboCids */
@@ -259,11 +259,11 @@ GetComboCommandId(CommandId cmin, CommandId cmax)
if (found)
{
- /* Reuse an existing combo cid */
+ /* Reuse an existing combo CID */
return entry->combocid;
}
- /* We have to create a new combo cid; we already made room in the array */
+ /* We have to create a new combo CID; we already made room in the array */
combocid = usedComboCids;
comboCids[combocid].cmin = cmin;
@@ -290,7 +290,7 @@ GetRealCmax(CommandId combocid)
}
/*
- * Estimate the amount of space required to serialize the current ComboCID
+ * Estimate the amount of space required to serialize the current combo CID
* state.
*/
Size
@@ -301,14 +301,14 @@ EstimateComboCIDStateSpace(void)
/* Add space required for saving usedComboCids */
size = sizeof(int);
- /* Add space required for saving the combocids key */
+ /* Add space required for saving ComboCidKeyData */
size = add_size(size, mul_size(sizeof(ComboCidKeyData), usedComboCids));
return size;
}
/*
- * Serialize the ComboCID state into the memory, beginning at start_address.
+ * Serialize the combo CID state into the memory, beginning at start_address.
* maxsize should be at least as large as the value returned by
* EstimateComboCIDStateSpace.
*/
@@ -317,7 +317,7 @@ SerializeComboCIDState(Size maxsize, char *start_address)
{
char *endptr;
- /* First, we store the number of currently-existing ComboCIDs. */
+ /* First, we store the number of currently-existing combo CIDs. */
*(int *) start_address = usedComboCids;
/* If maxsize is too small, throw an error. */
@@ -333,9 +333,9 @@ SerializeComboCIDState(Size maxsize, char *start_address)
}
/*
- * Read the ComboCID state at the specified address and initialize this
- * backend with the same ComboCIDs. This is only valid in a backend that
- * currently has no ComboCIDs (and only makes sense if the transaction state
+ * Read the combo CID state at the specified address and initialize this
+ * backend with the same combo CIDs. This is only valid in a backend that
+ * currently has no combo CIDs (and only makes sense if the transaction state
* is serialized and restored as well).
*/
void
@@ -348,11 +348,11 @@ RestoreComboCIDState(char *comboCIDstate)
Assert(!comboCids && !comboHash);
- /* First, we retrieve the number of ComboCIDs that were serialized. */
+ /* First, we retrieve the number of combo CIDs that were serialized. */
num_elements = *(int *) comboCIDstate;
keydata = (ComboCidKeyData *) (comboCIDstate + sizeof(int));
- /* Use GetComboCommandId to restore each ComboCID. */
+ /* Use GetComboCommandId to restore each combo CID. */
for (i = 0; i < num_elements; i++)
{
cid = GetComboCommandId(keydata[i].cmin, keydata[i].cmax);