Little cleanup of ShmemInit function names

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Little cleanup of ShmemInit function names
Date: 2024-08-07 12:08:42
Message-ID: c09694ff-2453-47e5-b26c-32a16cd75ce6@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

It's bothered me for a long time that some of the shmem initialization
functions have non-standard names. Most of them are called
FoobarShmemSize() and FoobarShmemInit(), but there are a few exceptions:

InitBufferPool
InitLocks
InitPredicateLocks
CreateSharedProcArray
CreateSharedBackendStatus
CreateSharedInvalidationState

I always have trouble remembering what exactly these functions do and
when get called. But they are the same as all the FoobarShmemInit()
functions, just named differently.

The attached patches rename them to follow the usual naming convention.
The InitLocks() function is refactored a bit more, splitting the
per-backend initialization to a separate InitLockManagerAccess()
function. That's why it's in a separate commit.

--
Heikki Linnakangas
Neon (https://neon.tech)

Attachment Content-Type Size
v1-0001-Refactor-lock-manager-initialization-to-make-it-a.patch text/x-patch 5.5 KB
v1-0002-Rename-some-shared-memory-initialization-routines.patch text/x-patch 11.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2024-08-07 12:13:17 Re: Found issues related with logical replication and 2PC
Previous Message Heikki Linnakangas 2024-08-07 11:24:39 Call rm_redo in a temporary memory context