1515 BOX2DF *unionL = NULL,
1519 maxoff = entryvec->n - 1;
1521 nbytes = (maxoff + 2) *
sizeof(OffsetNumber);
1522 v->spl_left = (OffsetNumber *) palloc(nbytes);
1523 v->spl_right = (OffsetNumber *) palloc(nbytes);
1524 v->spl_nleft = v->spl_nright = 0;
1526 for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
1528 BOX2DF *
cur = (BOX2DF *) DatumGetPointer(entryvec->vector[i].key);
1530 if (i <= (maxoff - FirstOffsetNumber + 1) / 2)
1532 v->spl_left[v->spl_nleft] = i;
1535 unionL = (BOX2DF *) palloc(
sizeof(BOX2DF));
1545 v->spl_right[v->spl_nright] = i;
1548 unionR = (BOX2DF *) palloc(
sizeof(BOX2DF));
1558 if (v->spl_ldatum_exists)
1559 adjustBox(unionL, (BOX2DF *) DatumGetPointer(v->spl_ldatum));
1560 v->spl_ldatum = BoxPGetDatum(unionL);
1562 if (v->spl_rdatum_exists)
1563 adjustBox(unionR, (BOX2DF *) DatumGetPointer(v->spl_rdatum));
1564 v->spl_rdatum = BoxPGetDatum(unionR);
1566 v->spl_ldatum_exists = v->spl_rdatum_exists =
false;
static void adjustBox(BOX2DF *b, BOX2DF *addon)