Re: Signed vs Unsigned (take 2) (src/backend/storage/ipc/procarray.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Signed vs Unsigned (take 2) (src/backend/storage/ipc/procarray.c)
Date: 2021-06-13 12:43:43
Message-ID: CAEudQApZTun+SUCOsJBi1eZeqALkzz+KsC7_HtZgiMs9TxVBZw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Andres, thanks for taking a look.

Em sáb., 12 de jun. de 2021 às 16:27, Andres Freund <andres(at)anarazel(dot)de>
escreveu:

> Hi,
>
> On 2021-06-12 10:55:22 -0300, Ranier Vilela wrote:
> > With the recent changes at procarray.c, I take a look in.
> > msvc compiler, has some warnings about signed vs unsigned.
>
> > 1. Size_t is weird, because all types are int.
>
> Not sure why I ended up using size_t here. There are cases where using a
> natively sized integer can lead to better code being generated, so I'd
> want to see some evaluation of the code generation effects.
>
Yes, sure.

>
>
> > 2. Wouldn't it be better to initialize static variables?
>
> No, explicit initialization needs additional space in the binary, and
> static variables are always zero initialized.
>
Yes, I missed this part.
But I was worried about this line:

/* hasn't been updated yet */
if (!TransactionIdIsValid(ComputeXidHorizonsResultLastXmin))

The first run with ComputeXidHorizonsResultLastXmin = 0, is ok?

>
> > 3. There are some shadowing parameters.
>
> Hm, yea, that's not great. Those are from
>
> commit 0e141c0fbb211bdd23783afa731e3eef95c9ad7a
> Author: Robert Haas <rhaas(at)postgresql(dot)org>
> Date: 2015-08-06 11:52:51 -0400
>
> Reduce ProcArrayLock contention by removing backends in batches.
>
> Amit, Robert, I assume you don't mind changing this?
>

>
>
> > 4. Possible loop beyond numProcs?
>
> What are you referring to here?
>
My mistake.

best regards,
Ranier Vilela

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2021-06-13 12:54:18 Re: An out-of-date comment in nodeIndexonlyscan.c
Previous Message Jonathan S. Katz 2021-06-13 12:29:38 Re: unnesting multirange data types