pgsql: Mark constantly allocated dest receiver as const.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Mark constantly allocated dest receiver as const.
Date: 2018-10-16 19:10:00
Message-ID: E1gCUjA-0003Kq-Eb@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Mark constantly allocated dest receiver as const.

This allows the compiler / linker to mark affected pages as read-only.

Doing so requires casting constness away, as CreateDestReceiver()
returns both constant and non-constant dest receivers. That's fine
though, as any modification of the statically allocated receivers
would already have been a bug (and would now be caught on some
platforms).

Discussion: https://postgr.es/m/20181015200754.7y7zfuzsoux2c4ya@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/93ca02e00560ad6553fbd8ebabb7d5349e98ade8

Modified Files
--------------
src/backend/tcop/dest.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-10-16 20:27:45 pgsql: Back off using -isysroot on Darwin.
Previous Message Tom Lane 2018-10-16 18:57:23 pgsql: Be smarter about age-counter overflow in formatting.c caches.