spin.c includes pg_sema.h even if unnecessary

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: spin.c includes pg_sema.h even if unnecessary
Date: 2018-02-15 11:11:07
Message-ID: 20180215.201107.78574525.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ouch! Sorry for the bogus subject of just-submitted mail.
I'll make another thread with the fixed subject.

====
Hello.

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
that.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
dont_include_pg_sema_when_HAVE_SPINLOCK.patch text/x-patch 684 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2018-02-15 11:13:32 Re: HAVE_SPINLOCKS still requests exctra shared memory
Previous Message Kyotaro HORIGUCHI 2018-02-15 11:07:03 HAVE_SPINLOCKS still requests exctra shared memory