mirror of
https://github.com/postgres/postgres.git
synced 2025-05-31 03:21:24 +03:00
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
This commit is contained in:
parent
80ad91ea8c
commit
3e9ca52601
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user