aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/bufmgr.c
diff options
context:
space:
mode:
authorKevin Grittner <kgrittn@postgresql.org>2016-04-11 16:47:50 -0500
committerKevin Grittner <kgrittn@postgresql.org>2016-04-11 16:47:50 -0500
commita6f6b78196a701702ec4ff6df56c346bdcf9abd2 (patch)
tree2ea1c8b8435f4a150510990f63100d7b98b5cd72 /src/backend/storage/buffer/bufmgr.c
parent80647bf65a03e232c995c0826ef394dad8d685fe (diff)
downloadpostgresql-a6f6b78196a701702ec4ff6df56c346bdcf9abd2.tar.gz
postgresql-a6f6b78196a701702ec4ff6df56c346bdcf9abd2.zip
Use static inline function for BufferGetPage()
I was initially concerned that the some of the hundreds of references to BufferGetPage() where the literal BGP_NO_SNAPSHOT_TEST were passed might not optimize as well as a macro, leading to some hard-to-find performance regressions in corner cases. Inspection of disassembled code has shown identical code at all inspected locations, and the size difference doesn't amount to even one byte per such call. So make it readable. Per gripes from Álvaro Herrera and Tom Lane
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r--src/backend/storage/buffer/bufmgr.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 29f10e59568..f402e0dd4b4 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -4295,7 +4295,7 @@ IssuePendingWritebacks(WritebackContext *context)
* For best performance, keep the tests that are fastest and/or most likely to
* exclude a page from old snapshot testing near the front.
*/
-extern Page
+extern void
TestForOldSnapshot(Snapshot snapshot, Relation relation, Page page)
{
Assert(relation != NULL);
@@ -4311,6 +4311,4 @@ TestForOldSnapshot(Snapshot snapshot, Relation relation, Page page)
ereport(ERROR,
(errcode(ERRCODE_SNAPSHOT_TOO_OLD),
errmsg("snapshot too old")));
-
- return page;
}