Re: Use macros for calculating LWLock offset

2020-11-23 Thread Li Japin
Thanks! On Nov 24, 2020, at 11:51 AM, Michael Paquier mailto:mich...@paquier.xyz>> wrote: On Fri, Nov 20, 2020 at 03:25:50PM +0900, Michael Paquier wrote: I agree that this makes this code a bit cleaner, so let's use those macros. Others may have some comments here, so let's wait a bit first.

Re: Use macros for calculating LWLock offset

2020-11-23 Thread Michael Paquier
On Fri, Nov 20, 2020 at 03:25:50PM +0900, Michael Paquier wrote: > I agree that this makes this code a bit cleaner, so let's use those > macros. Others may have some comments here, so let's wait a bit > first. Got this one committed as of d03d754. -- Michael signature.asc Description: PGP

Re: Use macros for calculating LWLock offset

2020-11-19 Thread Michael Paquier
On Thu, Nov 19, 2020 at 03:39:51PM +0800, japin wrote: > In the lwlock.c, InitializeLWLocks() calculate the LWLock offset by itself > (c319991bcad), > however, there are macros defined in lwlock.h, I think, we can use the > macros. I agree that this makes this code a bit cleaner, so let's use

Use macros for calculating LWLock offset

2020-11-18 Thread japin
Hi, In the lwlock.c, InitializeLWLocks() calculate the LWLock offset by itself (c319991bcad), however, there are macros defined in lwlock.h, I think, we can use the macros. diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 2fa90cc095..108e652179