Re: Signed vs Unsigned (take 2) (src/backend/storage/ipc/procarray.c) - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: Signed vs Unsigned (take 2) (src/backend/storage/ipc/procarray.c)
Date
Msg-id CAJ7c6TPmWDDEC5HOaGCegUQU60-3ddUassEXWzEANN=riQSuDg@mail.gmail.com
Whole thread Raw
In response to Re: Signed vs Unsigned (take 2) (src/backend/storage/ipc/procarray.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: Signed vs Unsigned (take 2) (src/backend/storage/ipc/procarray.c)
Re: Signed vs Unsigned (take 2) (src/backend/storage/ipc/procarray.c)
List pgsql-hackers
Hi hackers,

>> Patch attached.
> Added to next CF (https://commitfest.postgresql.org/33/3169/)

The proposed code casts `const` variables to non-`const`. I'm surprised MSVC misses it. Also, there were some issues with the code formatting. The corrected patch is attached.

The patch is listed under the "Performance" topic on CF. However, I can't verify any changes in the performance because there were no benchmarks attached that I could reproduce. By looking at the code and the first message in the thread, I assume this is in fact a refactoring.

Personally I don't believe that changes like:

-               for (int i = 0; i < nxids; i++)
+               int     i;
+               for (i = 0; i < nxids; i++)

.. or:

-       for (int index = myoff; index < arrayP->numProcs; index++)
+       numProcs = arrayP->numProcs;
+       for (index = myoff; index < numProcs; index++)

... are of any value, but other changes may be. I choose to keep the patch as-is except for the named defects and let the committer decide which changes, if any, are worth committing.

I'm updating the status to "Ready for Committer".

--
Best regards,
Aleksander Alekseev
Attachment

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: POC: Cleaning up orphaned files using undo logs
Next
From: Josef Šimánek
Date:
Subject: Re: Git revision in tarballs