pgsql: Replace static bufs with a StringInfo in cash_words()

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Replace static bufs with a StringInfo in cash_words()
Date: 2024-07-30 19:24:48
Message-ID: E1sYsSm-001vm4-06@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2024-07-30 23:51:38 pgsql: Relax check for return value from second call of pg_strnxfrm().
Previous Message Heikki Linnakangas 2024-07-30 12:20:38 pgsql: Remove leftover function declaration