Re: Increase repalloc_array() usage in buffile.c

From: "Tristan Partin" <tristan(at)partin(dot)io>
To: "Michael Paquier" <michael(at)paquier(dot)xyz>
Cc: "Sami Imseih" <samimseih(at)gmail(dot)com>, "Daniel Gustafsson" <daniel(at)yesql(dot)se>, "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Increase repalloc_array() usage in buffile.c
Date: 2026-08-08 05:19:59
Message-ID: DKJB5887LGX9.359DV1UMZ1URK@partin.io
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri Jul 31, 2026 at 7:35 AM UTC, Michael Paquier wrote:
> On Fri, Jul 31, 2026 at 03:54:33AM +0000, Tristan Partin wrote:
>> Let me see what I can come up with. As a committer, how would you like
>> the patches? I could do file by file, subsystem by subsystem, or just
>> one large single patch? I don't mind putting in the work to translate
>> all realloc calls where it makes sense, but I would like to make sure
>> I organize it in such a way to minimize work for you.
>
> All of these are mechanical changes, and it is possible to do a set of
> `git add` to split these across sub-directories. So a single huge
> patch does not change much compared to many small ones from my
> perspective. So your call.

Here are 3 patches that hope to modernize most vanilla palloc() calls
where appropriate.

--
Tristan Partin
PostgreSQL Contributors Team
AWS (https://aws.amazon.com)

Attachment Content-Type Size
v1-0001-Migrate-array-like-palloc-calls-to-palloc_array.patch text/x-patch 270.6 KB
v1-0002-Migrate-array-like-repalloc-calls-to-repalloc_arr.patch text/x-patch 76.7 KB
v1-0003-Migrate-object-like-palloc-calls-to-palloc_object.patch text/x-patch 21.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2026-08-08 06:10:05 Re: [Patch]The Case For WAL-Logging pg_upgrade
Previous Message Scott Ray 2026-08-08 01:58:49 Re: Report oldest xmin source when autovacuum cannot remove tuples