1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Change ginMergeItemPointers to return a palloc'd array.

That seems nicer than making it the caller's responsibility to pass a
suitable-sized array. All the callers were just palloc'ing an array anyway.
This commit is contained in:
Heikki Linnakangas
2014-03-24 18:40:26 +02:00
parent cf5d38f4b9
commit bb42e21be2
4 changed files with 30 additions and 32 deletions

View File

@@ -1303,10 +1303,9 @@ addItemsToLeaf(disassembledLeaf *leaf, ItemPointer newItems, int nNewItems)
if (!cur->items)
cur->items = ginPostingListDecode(cur->seg, &cur->nitems);
tmpitems = palloc((cur->nitems + nthis) * sizeof(ItemPointerData));
ntmpitems = ginMergeItemPointers(tmpitems,
cur->items, cur->nitems,
nextnew, nthis);
tmpitems = ginMergeItemPointers(cur->items, cur->nitems,
nextnew, nthis,
&ntmpitems);
if (ntmpitems != cur->nitems)
{
cur->items = tmpitems;