1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Correct constness of system attributes in heap.c & prerequisites.

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

There's a fair number of pre-requisite changes, to allow the const
properly be propagated. Most of consts were already required for
correctness anyway, just not represented on the type-level.  Arguably
we could be more aggressive in using consts in related code, but..

This requires using a few of the types underlying typedefs that
removes pointers (e.g. const NameData *) as declaring the typedefed
type constant doesn't have the same meaning (it makes the variable
const, not what it points to).

Discussion: https://postgr.es/m/20181015200754.7y7zfuzsoux2c4ya@alap3.anarazel.de
This commit is contained in:
Andres Freund
2018-10-16 09:44:43 -07:00
parent c015ccb306
commit 02a30a09f9
11 changed files with 32 additions and 31 deletions

View File

@@ -37,7 +37,7 @@ extern unsigned hex_decode(const char *src, unsigned len, char *dst);
extern int2vector *buildint2vector(const int16 *int2s, int n);
/* name.c */
extern int namecpy(Name n1, Name n2);
extern int namecpy(Name n1, const NameData *n2);
extern int namestrcpy(Name name, const char *str);
extern int namestrcmp(Name name, const char *str);