From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Clarify comment for worst-case allocation in quote_literal_cstr( |
Date: | 2025-04-07 01:16:03 |
Message-ID: | E1u1b5n-0032fb-0c@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Clarify comment for worst-case allocation in quote_literal_cstr()
palloc() is invoked with a specific formula for its allocation size in
quote_literal_cstr(). This wastes some memory, but the size is large
enough to cover even the worst-case scenarios.
No explanations were given about the reasons behind these numbers. This
commit adds more documentation about all that.
Author: Steve Chavez <steve(at)supabase(dot)io>
Discussion: https://postgr.es/m/CAGRrpzZ9bToRWS+fAnjxDJrxwZN1QcJ-y1Pn2yg=Hst6rydLtw@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c36eda259130faf3559b751b9e81a5c7e2bee0d7
Modified Files
--------------
src/backend/utils/adt/quote.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2025-04-07 03:57:59 | pgsql: libpq: Fix some issues in TAP tests for service files |
Previous Message | Michael Paquier | 2025-04-07 00:52:24 | pgsql: Fix use-after-free in pgstat_fetch_stat_backend_by_pid() |