Coccinelle for PostgreSQL development [5/N]: using palloc_array() and friends

From: Mats Kindahl <mats(at)timescale(dot)com>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Coccinelle for PostgreSQL development [5/N]: using palloc_array() and friends
Date: 2025-01-07 19:51:35
Message-ID: CA+14426-DTfrDM8JmO5npn+3uAYtXtd=vhM26vQzna+wLNU_NA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This is an example of a large-scale refactoring to improve the code.

For PostgreSQL 16, Peter extended the palloc()/pg_malloc() interface in
commit 2016055a92f to provide more type-safety, but these functions are not
widely used. This semantic patch captures and replaces all uses of palloc()
where palloc_array() or palloc_object() could be used instead.
--
Best wishes,
Mats Kindahl, Timescale

Attachment Content-Type Size
0005-Add-script-for-palloc_array.v1.patch text/x-patch 737.0 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-01-07 19:51:40 Re: Coccinelle for PostgreSQL development [2/N]: autoconf support [RESEND]
Previous Message Mats Kindahl 2025-01-07 19:49:45 Coccinelle for PostgreSQL development [4/N]: correcting palloc() use