mirror of
https://github.com/postgres/postgres.git
synced 2025-08-18 12:22:09 +03:00
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>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user