Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3e9ca52

Browse files
committed
Support gcc -fkeep-inline-functions
For some systems, we need to avoid unsatisfied-external-reference errors in static inlines. See 27d2693 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 2cd2569.) (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
1 parent 80ad91e commit 3e9ca52

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

src/include/storage/bufpage.h

+9-15
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,15 @@ do { \
466466
#define PIV_LOG_WARNING (1 << 0)
467467
#define PIV_REPORT_STAT (1 << 1)
468468

469+
#define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap) \
470+
PageAddItemExtended(page, item, size, offsetNumber, \
471+
((overwrite) ? PAI_OVERWRITE : 0) | \
472+
((is_heap) ? PAI_IS_HEAP : 0))
473+
474+
#define PageIsVerified(page, blkno) \
475+
PageIsVerifiedExtended(page, blkno, \
476+
PIV_LOG_WARNING | PIV_REPORT_STAT)
477+
469478
/*
470479
* Check that BLCKSZ is a multiple of sizeof(size_t). In
471480
* PageIsVerifiedExtended(), it is much faster to check if a page is
@@ -480,21 +489,6 @@ extern void PageInit(Page page, Size pageSize, Size specialSize);
480489
extern bool PageIsVerifiedExtended(Page page, BlockNumber blkno, int flags);
481490
extern OffsetNumber PageAddItemExtended(Page page, Item item, Size size,
482491
OffsetNumber offsetNumber, int flags);
483-
484-
static inline OffsetNumber
485-
PageAddItem(Page page, Item item, Size size, OffsetNumber offsetNumber, bool overwrite, bool is_heap)
486-
{
487-
return PageAddItemExtended(page, item, size, offsetNumber,
488-
(overwrite ? PAI_OVERWRITE : 0) |
489-
(is_heap ? PAI_IS_HEAP : 0));
490-
}
491-
492-
static inline bool
493-
PageIsVerified(Page page, BlockNumber blkno)
494-
{
495-
return PageIsVerifiedExtended(page, blkno, PIV_LOG_WARNING | PIV_REPORT_STAT);
496-
}
497-
498492
extern Page PageGetTempPage(Page page);
499493
extern Page PageGetTempPageCopy(Page page);
500494
extern Page PageGetTempPageCopySpecial(Page page);

src/include/utils/rel.h

+2
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ typedef struct ViewOptions
551551
(RELKIND_HAS_STORAGE((relation)->rd_rel->relkind) && \
552552
((relation)->rd_rel->relfilenode == InvalidRelFileNumber))
553553

554+
#ifndef FRONTEND
554555
/*
555556
* RelationGetSmgr
556557
* Returns smgr file handle for a relation, opening it if needed.
@@ -571,6 +572,7 @@ RelationGetSmgr(Relation rel)
571572
smgrsetowner(&(rel->rd_smgr), smgropen(rel->rd_locator, rel->rd_backend));
572573
return rel->rd_smgr;
573574
}
575+
#endif
574576

575577
/*
576578
* RelationCloseSmgr

src/include/utils/snapmgr.h

+2
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ extern PGDLLIMPORT SnapshotData CatalogSnapshotData;
9797
((snapshot)->snapshot_type == SNAPSHOT_MVCC || \
9898
(snapshot)->snapshot_type == SNAPSHOT_HISTORIC_MVCC)
9999

100+
#ifndef FRONTEND
100101
static inline bool
101102
OldSnapshotThresholdActive(void)
102103
{
103104
return old_snapshot_threshold >= 0;
104105
}
106+
#endif
105107

106108
extern Snapshot GetTransactionSnapshot(void);
107109
extern Snapshot GetLatestSnapshot(void);

0 commit comments

Comments
 (0)