Rename functions to alloc/free things in reorderbuffer.c

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2025-03-12T17:53:08Z
Lists: pgsql-hackers

Attachments

I noticed some weird naming conventions in reorderbuffer.c which are 
leftovers from a long time ago when reorderbuffer.c maintained its own 
small memory pools to reduce palloc/pfree overhead. For example:

extern Oid *ReorderBufferGetRelids(ReorderBuffer *rb, int nrelids);
extern void ReorderBufferReturnRelids(ReorderBuffer *rb, Oid *relids);

ReorderBufferGetRelids allocates an array with MemoryContextAlloc, and 
ReorderBufferReturnRelids just calls pfree. The pools are long gone, and 
now the naming looks weird.

Attached patch renames those functions and other such functions to use 
the terms Alloc/Free. I actually wonder if we should go further and 
remove these functions altogether, and change the callers to call 
MemoryContextAlloc directly. But I didn't do that yet.

Any objections?

-- 
Heikki Linnakangas
Neon (https://neon.tech)

Commits

  1. Rename alloc/free functions in reorderbuffer.c