1411 BOX2DF *unionL = NULL,
1415 maxoff = entryvec->n - 1;
1417 nbytes = (maxoff + 2) *
sizeof(OffsetNumber);
1418 v->spl_left = (OffsetNumber *) palloc(nbytes);
1419 v->spl_right = (OffsetNumber *) palloc(nbytes);
1420 v->spl_nleft = v->spl_nright = 0;
1422 for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
1424 BOX2DF *
cur = (BOX2DF *) DatumGetPointer(entryvec->vector[i].key);
1426 if (i <= (maxoff - FirstOffsetNumber + 1) / 2)
1428 v->spl_left[v->spl_nleft] = i;
1431 unionL = (BOX2DF *) palloc(
sizeof(BOX2DF));
1441 v->spl_right[v->spl_nright] = i;
1444 unionR = (BOX2DF *) palloc(
sizeof(BOX2DF));
1454 if (v->spl_ldatum_exists)
1455 adjustBox(unionL, (BOX2DF *) DatumGetPointer(v->spl_ldatum));
1456 v->spl_ldatum = PointerGetDatum(unionL);
1458 if (v->spl_rdatum_exists)
1459 adjustBox(unionR, (BOX2DF *) DatumGetPointer(v->spl_rdatum));
1460 v->spl_rdatum = PointerGetDatum(unionR);
1462 v->spl_ldatum_exists = v->spl_rdatum_exists =
false;
static void adjustBox(BOX2DF *b, BOX2DF *addon)