Re: spin.c includes pg_sema.h even if unnecessary

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: andres(at)anarazel(dot)de
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: spin.c includes pg_sema.h even if unnecessary
Date: 2018-02-16 04:42:49
Message-ID: 20180216.134249.72126769.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 15 Feb 2018 10:01:57 -0800, Andres Freund <andres(at)anarazel(dot)de> wrote in <20180215180157(dot)7q55aytrhif7vvzw(at)alap3(dot)anarazel(dot)de>
> On 2018-02-15 20:11:07 +0900, Kyotaro HORIGUCHI wrote:
> > As in another mail just before, spin.c seems a bit strange
> > (without acutual harm).
> >
> > spin.h doesn't include pg_sema.h when HAVE_SPINLOCKS is defined,
> > but spin.c always includes it even in the case. The file is
> > included only to use sizeof(PGSemaphore) to calcualte
> > SpinlockSemaSize as 0.
> >
> > The codes that requires PGSempaphore is inactivated when the
> > symbol is defined in all other places so it seems to me that we
> > ought to refrain from using it there, too. The attched patch does
>
> IDK, I don't quite see the point of the change here...

No actual gain, but I just feel it uneasy that utterly-unused
symbol is used to yield zero. From other point of view, it seems
to be inconsistency that a header file is disabled in a file, but
not disabled in another on one configuration.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2018-02-16 05:01:45 Re: Let's remove DSM_INPL_NONE.
Previous Message Amit Langote 2018-02-16 04:42:12 Re: non-bulk inserts and tuple routing