diff options
author | Neil Conway <neilc@samurai.com> | 2005-05-21 12:08:06 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2005-05-21 12:08:06 +0000 |
commit | 36ab6005119532903d4ce3ad564e6576bd7698b8 (patch) | |
tree | fb6f1c25a78b5fe285a7496c4893565b76c5893f /contrib/rtree_gist/rtree_gist.c | |
parent | 875813439d0659a2adacc54409793a793f959ea7 (diff) | |
download | postgresql-36ab6005119532903d4ce3ad564e6576bd7698b8.tar.gz postgresql-36ab6005119532903d4ce3ad564e6576bd7698b8.zip |
Cleanup of GiST extensions in contrib/: now that we always invoke GiST
methods in a short-lived memory context, there is no need for GiST methods
to do their own manual (and error-prone) memory management.
Diffstat (limited to 'contrib/rtree_gist/rtree_gist.c')
-rw-r--r-- | contrib/rtree_gist/rtree_gist.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/contrib/rtree_gist/rtree_gist.c b/contrib/rtree_gist/rtree_gist.c index 92714522d80..d2f41569200 100644 --- a/contrib/rtree_gist/rtree_gist.c +++ b/contrib/rtree_gist/rtree_gist.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/contrib/rtree_gist/rtree_gist.c,v 1.10 2004/08/29 05:06:37 momjian Exp $ + * $PostgreSQL: pgsql/contrib/rtree_gist/rtree_gist.c,v 1.11 2005/05/21 12:08:05 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -152,9 +152,6 @@ gbox_penalty(PG_FUNCTION_ARGS) ud = DirectFunctionCall2(rt_box_union, origentry->key, newentry->key); tmp1 = size_box(ud); - if (DatumGetPointer(ud) != NULL) - pfree(DatumGetPointer(ud)); - *result = tmp1 - size_box(origentry->key); PG_RETURN_POINTER(result); } @@ -342,7 +339,6 @@ gbox_picksplit(PG_FUNCTION_ARGS) else ADDLIST(listT, unionT, posT, arr[i - 1].pos); } - pfree(arr); } /* which split more optimal? */ @@ -372,11 +368,6 @@ gbox_picksplit(PG_FUNCTION_ARGS) if (direction == 'x') { - pfree(unionB); - pfree(listB); - pfree(unionT); - pfree(listT); - v->spl_left = listL; v->spl_right = listR; v->spl_nleft = posL; @@ -386,11 +377,6 @@ gbox_picksplit(PG_FUNCTION_ARGS) } else { - pfree(unionR); - pfree(listR); - pfree(unionL); - pfree(listL); - v->spl_left = listB; v->spl_right = listT; v->spl_nleft = posB; @@ -497,9 +483,6 @@ gpoly_compress(PG_FUNCTION_ARGS) in = (POLYGON *) PG_DETOAST_DATUM(entry->key); r = (BOX *) palloc(sizeof(BOX)); memcpy((void *) r, (void *) &(in->boundbox), sizeof(BOX)); - if (in != (POLYGON *) DatumGetPointer(entry->key)) - pfree(in); - gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, entry->offset, sizeof(BOX), FALSE); |