From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
---|---|
To: | Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Ildus Kurbangaliev <i(dot)kurbangaliev(at)postgrespro(dot)ru>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
Subject: | Re: [PATCH] Refactoring of LWLock tranches |
Date: | 2016-02-01 05:27:53 |
Message-ID: | CAA4eK1JPc75fRtrZVcqG2TYCK9_c7j4nCLme+yc8o6wqG_mP6g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sat, Jan 30, 2016 at 12:23 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
wrote:
> On Fri, Jan 29, 2016 at 6:55 PM, Alexander Korotkov <
> a(dot)korotkov(at)postgrespro(dot)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)));
>
>
Changed as per your suggestion, rather than using Min,
because I saw most code places uses directly sizeof for
StrNCpy(), so lets be consistent.
>
>
>> 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.
>
>
Fixed.
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
Attachment | Content-Type | Size |
---|---|---|
separate_tranche_extensions_v3.patch | application/octet-stream | 16.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2016-02-01 05:38:19 | Re: Patch: make behavior of all versions of the "isinf" function be similar |
Previous Message | Michael Paquier | 2016-02-01 04:53:53 | Re: pglogical_output - a general purpose logical decoding output plugin |