aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistvacuum.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-11-03 20:47:49 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-11-03 20:47:49 +0000
commitb4eae023bb2b5e9bce96cd367d70c180eefe6bf9 (patch)
tree5fc3b8619b94897cf1b6ac884423226254c98578 /src/backend/access/gist/gistvacuum.c
parentf0dae70431ec0af676d7e6f26454145903045aba (diff)
downloadpostgresql-b4eae023bb2b5e9bce96cd367d70c180eefe6bf9.tar.gz
postgresql-b4eae023bb2b5e9bce96cd367d70c180eefe6bf9.zip
Clean up the messy semantics (not to mention inefficiency) of PageGetTempPage
by splitting it into three functions with better-defined behaviors. Zdenek Kotala
Diffstat (limited to 'src/backend/access/gist/gistvacuum.c')
-rw-r--r--src/backend/access/gist/gistvacuum.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/backend/access/gist/gistvacuum.c b/src/backend/access/gist/gistvacuum.c
index 80710ae7368..d933fea25b2 100644
--- a/src/backend/access/gist/gistvacuum.c
+++ b/src/backend/access/gist/gistvacuum.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gist/gistvacuum.c,v 1.39 2008/10/31 15:04:59 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gist/gistvacuum.c,v 1.40 2008/11/03 20:47:48 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -144,18 +144,6 @@ gistDeleteSubtree(GistVacuum *gv, BlockNumber blkno)
UnlockReleaseBuffer(buffer);
}
-static Page
-GistPageGetCopyPage(Page page)
-{
- Size pageSize = PageGetPageSize(page);
- Page tmppage;
-
- tmppage = (Page) palloc(pageSize);
- memcpy(tmppage, page, pageSize);
-
- return tmppage;
-}
-
static ArrayTuple
vacuumSplitPage(GistVacuum *gv, Page tempPage, Buffer buffer, IndexTuple *addon, int curlenaddon)
{
@@ -325,7 +313,7 @@ gistVacuumUpdate(GistVacuum *gv, BlockNumber blkno, bool needunion)
addon = (IndexTuple *) palloc(sizeof(IndexTuple) * lenaddon);
/* get copy of page to work */
- tempPage = GistPageGetCopyPage(page);
+ tempPage = PageGetTempPageCopy(page);
for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
{