diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-09-09 18:17:07 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-09-09 18:17:07 -0400 |
commit | 1a4be103a523db8d47b464463ba175cc664442b2 (patch) | |
tree | 51b2d399b5d8531f049001d8d0a6bf4366a1b7dc /src/backend/storage/page/bufpage.c | |
parent | b1328d78f88cdf4f7504004159e530b776f0de16 (diff) | |
download | postgresql-1a4be103a523db8d47b464463ba175cc664442b2.tar.gz postgresql-1a4be103a523db8d47b464463ba175cc664442b2.zip |
Convert PageAddItem into a macro to save a few cycles.
Nowadays this is just a backwards-compatibility wrapper around
PageAddItemExtended, so let's avoid the extra level of function call.
In addition, because pretty much all callers are passing constants
for the two bool arguments, compilers will be able to constant-fold
the conversion to a flags bitmask.
Discussion: <552.1473445163@sss.pgh.pa.us>
Diffstat (limited to 'src/backend/storage/page/bufpage.c')
-rw-r--r-- | src/backend/storage/page/bufpage.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/backend/storage/page/bufpage.c b/src/backend/storage/page/bufpage.c index 08e222e583b..41a7dd0d622 100644 --- a/src/backend/storage/page/bufpage.c +++ b/src/backend/storage/page/bufpage.c @@ -338,26 +338,6 @@ PageAddItemExtended(Page page, return offsetNumber; } -/* - * PageAddItem - * - * Add an item to a page. Return value is offset at which it was - * inserted, or InvalidOffsetNumber if the item is not inserted for - * any reason. - * - * Passing the 'overwrite' and 'is_heap' parameters as true causes the - * PAI_OVERWRITE and PAI_IS_HEAP flags to be set, respectively. - * - * !!! EREPORT(ERROR) IS DISALLOWED HERE !!! - */ -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); -} /* * PageGetTempPage |