Re: Use pg_malloc macros in src/fe_utils

Andreas Karlsson <andreas@proxel.se>

From: Andreas Karlsson <andreas@proxel.se>
To: Henrik TJ <henrik@0x48.dk>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2026-02-23T02:17:52Z
Lists: pgsql-hackers
On 2/18/26 4:05 PM, Henrik TJ wrote:
> Inspired by [1], I took a stab at converting src/fe_utils to the new 
> pg_malloc macros.
Thanks for the patch!

Looks like a nice change but why not just fix all instances of it in one 
swoop? It cannot be that many as there are 166 calls to pg_malloc() and 
62 calls to pg_malloc0() after your patch that need to be looked at.

-- 
Andreas Karlsson
Percona




Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Use pg_malloc_object() and pg_alloc_array() variants in frontend code

  2. fe_utils: Sprinkle some pg_malloc_object() and pg_malloc_array()