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/pg_trgm/trgm_gist.c | |
parent | 875813439d0659a2adacc54409793a793f959ea7 (diff) |
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/pg_trgm/trgm_gist.c')
-rw-r--r-- | contrib/pg_trgm/trgm_gist.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/contrib/pg_trgm/trgm_gist.c b/contrib/pg_trgm/trgm_gist.c index 3ae8f4b3aa2..33ed6d5e1f0 100644 --- a/contrib/pg_trgm/trgm_gist.c +++ b/contrib/pg_trgm/trgm_gist.c @@ -91,13 +91,9 @@ gtrgm_compress(PG_FUNCTION_ARGS) if (entry->leafkey) { /* trgm */ TRGM *res; - text *toastedval = (text *) DatumGetPointer(entry->key); text *val = (text *) DatumGetPointer(PG_DETOAST_DATUM(entry->key)); res = generate_trgm(VARDATA(val), VARSIZE(val) - VARHDRSZ); - if (val != toastedval) - pfree(val); - retval = (GISTENTRY *) palloc(sizeof(GISTENTRY)); gistentryinit(*retval, PointerGetDatum(res), entry->rel, entry->page, @@ -175,9 +171,6 @@ gtrgm_consistent(PG_FUNCTION_ARGS) #endif } - PG_FREE_IF_COPY(query, 1); - pfree(qtrg); - PG_RETURN_BOOL(res); } @@ -603,8 +596,6 @@ gtrgm_picksplit(PG_FUNCTION_ARGS) } *right = *left = FirstOffsetNumber; - pfree(costvector); - pfree(cache); v->spl_ldatum = PointerGetDatum(datum_l); v->spl_rdatum = PointerGetDatum(datum_r); |