This is similar to the other page accessors in bufpage.h. It improves
readability and avoids long lines.
Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/
BD8B69E7-26D8-4706-9164-
597C6AE57812%40gmail.com
* determining the appropriate horizon is a waste if there's no prune_xid
* (i.e. no updates/deletes left potentially dead tuples around).
*/
- prune_xid = ((PageHeader) page)->pd_prune_xid;
+ prune_xid = PageGetPruneXid(page);
if (!TransactionIdIsValid(prune_xid))
return;
* pd_prune_xid field or the page was marked full, we will update the hint
* bit.
*/
- do_hint_prune = ((PageHeader) prstate.page)->pd_prune_xid != prstate.new_prune_xid ||
+ do_hint_prune = PageGetPruneXid(prstate.page) != prstate.new_prune_xid ||
PageIsFull(prstate.page);
/*
((PageHeader) page)->pd_flags &= ~PD_ALL_VISIBLE;
}
+static inline TransactionId
+PageGetPruneXid(const PageData *page)
+{
+ return ((const PageHeaderData *) page)->pd_prune_xid;
+}
+
/*
* These two require "access/transam.h", so left as macros.
*/