aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-07-15 12:05:01 +0200
committerPeter Eisentraut <peter@eisentraut.org>2022-07-15 12:12:30 +0200
commit3e9ca526012b0913db8285211ee52d5d6225334d (patch)
tree9ee47376768ef7785e50b9e8de60d5ad9260508a /src
parent80ad91ea8cfca6c817034423fc889876217c67af (diff)
downloadpostgresql-3e9ca526012b0913db8285211ee52d5d6225334d.tar.gz
postgresql-3e9ca526012b0913db8285211ee52d5d6225334d.zip
Support gcc -fkeep-inline-functions
For some systems, we need to avoid unsatisfied-external-reference errors in static inlines. See 27d2693187d1bcf2563ee7142ba37d4788c8d52b for example. In order to test that on other systems, the gcc option -fkeep-inline-functions can be used. But it actually is a bit stricter than what we currently have in place, so fix up a few more places along the lines of the above commit. (This undoes part of commit 2cd2569c72b8920048e35c31c9be30a6170e1410.) (Note, this does not add that gcc option anywhere to the build system, it just makes it possible to use it successfully manually.) Discussion: https://www.postgresql.org/message-id/flat/E1oBgIW-002ehP-VJ%40gemulon.postgresql.org
Diffstat (limited to 'src')
-rw-r--r--src/include/storage/bufpage.h24
-rw-r--r--src/include/utils/rel.h2
-rw-r--r--src/include/utils/snapmgr.h2
3 files changed, 13 insertions, 15 deletions
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h
index fc67d396b6b..6a947021aca 100644
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -466,6 +466,15 @@ do { \
#define PIV_LOG_WARNING (1 << 0)
#define PIV_REPORT_STAT (1 << 1)
+#define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap) \
+ PageAddItemExtended(page, item, size, offsetNumber, \
+ ((overwrite) ? PAI_OVERWRITE : 0) | \
+ ((is_heap) ? PAI_IS_HEAP : 0))
+
+#define PageIsVerified(page, blkno) \
+ PageIsVerifiedExtended(page, blkno, \
+ PIV_LOG_WARNING | PIV_REPORT_STAT)
+
/*
* Check that BLCKSZ is a multiple of sizeof(size_t). In
* PageIsVerifiedExtended(), it is much faster to check if a page is
@@ -480,21 +489,6 @@ extern void PageInit(Page page, Size pageSize, Size specialSize);
extern bool PageIsVerifiedExtended(Page page, BlockNumber blkno, int flags);
extern OffsetNumber PageAddItemExtended(Page page, Item item, Size size,
OffsetNumber offsetNumber, int flags);
-
-static inline OffsetNumber
-PageAddItem(Page page, Item item, Size size, OffsetNumber offsetNumber, bool overwrite, bool is_heap)
-{
- return PageAddItemExtended(page, item, size, offsetNumber,
- (overwrite ? PAI_OVERWRITE : 0) |
- (is_heap ? PAI_IS_HEAP : 0));
-}
-
-static inline bool
-PageIsVerified(Page page, BlockNumber blkno)
-{
- return PageIsVerifiedExtended(page, blkno, PIV_LOG_WARNING | PIV_REPORT_STAT);
-}
-
extern Page PageGetTempPage(Page page);
extern Page PageGetTempPageCopy(Page page);
extern Page PageGetTempPageCopySpecial(Page page);
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index 2854839ec2c..7dc401cf0df 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -551,6 +551,7 @@ typedef struct ViewOptions
(RELKIND_HAS_STORAGE((relation)->rd_rel->relkind) && \
((relation)->rd_rel->relfilenode == InvalidRelFileNumber))
+#ifndef FRONTEND
/*
* RelationGetSmgr
* Returns smgr file handle for a relation, opening it if needed.
@@ -571,6 +572,7 @@ RelationGetSmgr(Relation rel)
smgrsetowner(&(rel->rd_smgr), smgropen(rel->rd_locator, rel->rd_backend));
return rel->rd_smgr;
}
+#endif
/*
* RelationCloseSmgr
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index 67b217b1c11..06eafdf118a 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -97,11 +97,13 @@ extern PGDLLIMPORT SnapshotData CatalogSnapshotData;
((snapshot)->snapshot_type == SNAPSHOT_MVCC || \
(snapshot)->snapshot_type == SNAPSHOT_HISTORIC_MVCC)
+#ifndef FRONTEND
static inline bool
OldSnapshotThresholdActive(void)
{
return old_snapshot_threshold >= 0;
}
+#endif
extern Snapshot GetTransactionSnapshot(void);
extern Snapshot GetLatestSnapshot(void);