mirror of
https://github.com/postgres/postgres.git
synced 2025-11-24 00:23:06 +03:00
Initialize ShmemVariableCache like other shmem areas
For sake of consistency. Reviewed-by: Tristan Partin, Richard Guo Discussion: https://www.postgresql.org/message-id/6537d63d-4bb5-46f8-9b5d-73a8ba4720ab@iki.fi
This commit is contained in:
@@ -34,6 +34,33 @@
|
||||
VariableCache ShmemVariableCache = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Initialization of shared memory for ShmemVariableCache.
|
||||
*/
|
||||
Size
|
||||
VarsupShmemSize(void)
|
||||
{
|
||||
return sizeof(VariableCacheData);
|
||||
}
|
||||
|
||||
void
|
||||
VarsupShmemInit(void)
|
||||
{
|
||||
bool found;
|
||||
|
||||
/* Initialize our shared state struct */
|
||||
ShmemVariableCache = ShmemInitStruct("ShmemVariableCache",
|
||||
sizeof(VariableCacheData),
|
||||
&found);
|
||||
if (!IsUnderPostmaster)
|
||||
{
|
||||
Assert(!found);
|
||||
memset(ShmemVariableCache, 0, sizeof(VariableCacheData));
|
||||
}
|
||||
else
|
||||
Assert(found);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate the next FullTransactionId for a new transaction or
|
||||
* subtransaction.
|
||||
|
||||
Reference in New Issue
Block a user