| From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
|---|---|
| To: | Tatsuo Ishii <ishii(at)postgresql(dot)org>, michael(at)paquier(dot)xyz |
| Cc: | dgrowleyml(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: Proposal: add new API to stringinfo |
| Date: | 2025-01-03 22:16:58 |
| Message-ID: | 2562b824-262c-40c8-bd91-6427b5193436@dunslane.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 2024-12-28 Sa 12:45 AM, Tatsuo Ishii wrote:
> Michael said:
>> New APIs are materials for HEAD, so recompilation needs to happen
>> anyway. Using a macro makes things slightly simpler and it would not
>> break unnecessarily the compilation of existing extensions.
> Ok.
>
> David said:
>> I didn't review the patch in detail, but I think "initsize" would be a
>> better parameter name than "size".
> Ok, will change to "initsize".
>
> With opinions from Michael and David , what about following additional APIs?
>
> #define STRINGINFO_DEFAULT_SIZE 1024 /* default initial allocation size */
> #define STRINGINFO_SMALL_SIZE 64 /* small initial allocation size */
>
> #define makeStringInfo makeStringInfoExtended(STRINGINFO_DEFAULT_SIZE)
> #define initStringInfo(str) initStringInfoExtended(str, STRINGINFO_DEFAULT_SIZE)
>
> extern StringInfo makeStringInfoExtended(int initsize);
> extern void initStringInfoExtended(StringInfo str, int initsize);
>
Seems like a good idea.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Gurjeet Singh | 2025-01-03 22:55:04 | Re: Proposal: add new API to stringinfo |
| Previous Message | James Hunter | 2025-01-03 21:16:45 | Re: Add the ability to limit the amount of memory that can be allocated to backends. |