From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Replace static bufs with a StringInfo in cash_words()
Date: Tue, 30 Jul 2024 19:24:48 +0000
Message-ID: <E1sYsSm-001vm4-06@gemulon.postgresql.org> (raw)
Replace static bufs with a StringInfo in cash_words()
For clarity. The code was correct, and the buffer was large enough,
but string manipulation with no bounds checking is scary.
This incurs an extra palloc+pfree to every call, but in quick
performance testing, it doesn't seem to be significant.
Reviewed-by: Robert Haas
Discussion: https://www.postgresql.org/message-id/7f86e06a-98c5-4ce3-8ec9-3885c8de0358@iki.fi
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5bf948d564e36553d2a1cda3244a52d054238af4
Modified Files
--------------
src/backend/utils/adt/cash.c | 85 +++++++++++++++++++++++---------------------
1 file changed, 44 insertions(+), 41 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: heikki.linnakangas@iki.fi
Subject: Re: pgsql: Replace static bufs with a StringInfo in cash_words()
In-Reply-To: <E1sYsSm-001vm4-06@gemulon.postgresql.org>
References: <E1sYsSm-001vm4-06@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