Skip to content

Commit 0fd0f36

Browse files
committed
Document and clean up gistsplit.c.
Improve comments, rename some variables and functions, slightly simplify a couple of APIs, in an attempt to make this code readable by people other than its original author. Even though this is essentially just cosmetic, back-patch to all active branches, because otherwise it's going to make back-patching future fixes in this file very painful.
1 parent a187c96 commit 0fd0f36

File tree

4 files changed

+319
-170
lines changed

4 files changed

+319
-170
lines changed

src/backend/access/gist/gist.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,18 +1237,12 @@ gistSplit(Relation r,
12371237
IndexTuple *lvectup,
12381238
*rvectup;
12391239
GistSplitVector v;
1240-
GistEntryVector *entryvec;
12411240
int i;
12421241
SplitedPageLayout *res = NULL;
12431242

1244-
/* generate the item array */
1245-
entryvec = palloc(GEVHDRSZ + (len + 1) * sizeof(GISTENTRY));
1246-
entryvec->n = len + 1;
1247-
12481243
memset(v.spl_lisnull, TRUE, sizeof(bool) * giststate->tupdesc->natts);
12491244
memset(v.spl_risnull, TRUE, sizeof(bool) * giststate->tupdesc->natts);
1250-
gistSplitByKey(r, page, itup, len, giststate,
1251-
&v, entryvec, 0);
1245+
gistSplitByKey(r, page, itup, len, giststate, &v, 0);
12521246

12531247
/* form left and right vector */
12541248
lvectup = (IndexTuple *) palloc(sizeof(IndexTuple) * (len + 1));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy