1283 BOX2DF *unionL = NULL,
1287 maxoff = entryvec->n - 1;
1289 nbytes = (maxoff + 2) *
sizeof(OffsetNumber);
1290 v->spl_left = (OffsetNumber *) palloc(nbytes);
1291 v->spl_right = (OffsetNumber *) palloc(nbytes);
1292 v->spl_nleft = v->spl_nright = 0;
1294 for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
1296 BOX2DF *
cur = (BOX2DF *) DatumGetPointer(entryvec->vector[i].key);
1298 if (i <= (maxoff - FirstOffsetNumber + 1) / 2)
1300 v->spl_left[v->spl_nleft] = i;
1303 unionL = (BOX2DF *) palloc(
sizeof(BOX2DF));
1313 v->spl_right[v->spl_nright] = i;
1316 unionR = (BOX2DF *) palloc(
sizeof(BOX2DF));
1326 if (v->spl_ldatum_exists)
1327 adjustBox(unionL, (BOX2DF *) DatumGetPointer(v->spl_ldatum));
1328 v->spl_ldatum = BoxPGetDatum(unionL);
1330 if (v->spl_rdatum_exists)
1331 adjustBox(unionR, (BOX2DF *) DatumGetPointer(v->spl_rdatum));
1332 v->spl_rdatum = BoxPGetDatum(unionR);
1334 v->spl_ldatum_exists = v->spl_rdatum_exists =
false;
static void adjustBox(BOX2DF *b, BOX2DF *addon)