Re: Bugfix and improvements in multixact.c
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Maxim Orlov <orlovmg@gmail.com>,
Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-06-16T17:54:16Z
Lists: pgsql-hackers
On 14/06/2024 16:56, Maxim Orlov wrote:
> +static inline int
> +MXOffsetToFlagsOffset(MultiXactOffset offset)
> +{
> + int flagsoff;
> +
> + offset /= MULTIXACT_MEMBERS_PER_MEMBERGROUP;
> + offset %= MULTIXACT_MEMBERGROUPS_PER_PAGE;
> + flagsoff = offset * MULTIXACT_MEMBERGROUP_SIZE;
> +
> + return flagsoff;
> +}
I found this reuse of the 'offset' variable a bit confusing, so I added
separate local variables for each step.
Committed with that change, thanks!
--
Heikki Linnakangas
Neon (https://neon.tech)
Commits
-
Convert confusing macros in multixact.c to static inline functions
- 0099b9408e8c 17.0 landed