Re: [PATCH] Refactoring of LWLock tranches - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [PATCH] Refactoring of LWLock tranches
Date
Msg-id CAA4eK1KCOU1D1-8s-eQPtXMshe=GFPbhhKJrO2vB-FVRRWA9FA@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Refactoring of LWLock tranches  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: [PATCH] Refactoring of LWLock tranches  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Fri, Jan 29, 2016 at 6:55 PM, Alexander Korotkov <a.korotkov@postgrespro.ru> wrote:
Also couple of minor comments from me.

I think this

+ StrNCpy(LWLockTrancheRequestArray[LWLockTrancheRequestsCount].tranche_name, tranche_name, strlen(tranche_name) + 1);

should be 

+ StrNCpy(LWLockTrancheRequestArray[LWLockTrancheRequestsCount].tranche_name, tranche_name, sizeof(LWLockTrancheRequestArray[LWLockTrancheRequestsCount].tranche_name));


I think you are right, otherwise it might try to copy more, how
about

StrNCpy(LWLockTrancheRequestArray[LWLockTrancheRequestsCount].tranche_name, tranche_name, Min (strlen(tranche_name) + 1, sizeof(LWLockTrancheRequestArray[LWLockTrancheRequestsCount].tranche_name)));

 
And as far as I know english "it's" should be "its" in the sentence below.

+     from <function>_PG_init</>.  Tranche repersents an array of LWLocks and
+     can be accessed by it's name.  First parameter <literal>tranche_name</>


Right, will change.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [PATCH] Refactoring of LWLock tranches
Next
From: Peter Geoghegan
Date:
Subject: Re: Using quicksort for every external sort run