From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove useless pfree()s at the ends of various ValuePerCall SRFs
Date: Tue, 17 Mar 2020 01:36:57 +0000
Message-ID: <E1jE1A9-00033u-HT@gemulon.postgresql.org> (raw)
Remove useless pfree()s at the ends of various ValuePerCall SRFs.
We don't need to manually clean up allocations in a SRF's
multi_call_memory_ctx, because the SRF_RETURN_DONE infrastructure
takes care of that (and also ensures that it will happen even if the
function never gets a final call, which simple manual cleanup cannot
do).
Hence, the code removed by this patch is a waste of code and cycles.
Worse, it gives the impression that cleaning up manually is a thing,
which can lead to more serious errors such as those fixed in
commits 085b6b667 and b4570d33a. So we should get rid of it.
These are not quite actual bugs though, so I couldn't muster the
enthusiasm to back-patch. Fix in HEAD only.
Justin Pryzby
Discussion: https://postgr.es/m/20200308173103.GC1357@telsasoft.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/41b45576d532ab6ef4a968f78b5b06d700ebf61f
Modified Files
--------------
contrib/pageinspect/btreefuncs.c | 15 ++++-----------
contrib/pageinspect/ginfuncs.c | 4 ++--
contrib/pageinspect/hashfuncs.c | 7 ++-----
src/backend/access/transam/multixact.c | 4 ----
src/backend/tsearch/wparser.c | 9 ---------
src/backend/utils/adt/jsonfuncs.c | 14 --------------
src/backend/utils/adt/tsvector_op.c | 1 -
7 files changed, 8 insertions(+), 46 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Remove useless pfree()s at the ends of various ValuePerCall SRFs
In-Reply-To: <E1jE1A9-00033u-HT@gemulon.postgresql.org>
References: <E1jE1A9-00033u-HT@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox