From: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Rename functions to alloc/free things in reorderbuffer.c |
Date: | 2025-03-12 20:04:36 |
Message-ID: | 0b6e0f03-e316-4a06-8cda-d18c1bbd8bf1@iki.fi |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 12/03/2025 21:31, Tom Lane wrote:
> Heikki Linnakangas <hlinnaka(at)iki(dot)fi> writes:
>> 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.
>
> Yeah, that is very confusing, especially since nearby code uses
> names like ReorderBufferGetFoo for functions that are lookups not
> allocations. +1 for Alloc/Free where that's an accurate description.
Committed, thanks!
> Given that a lot of these are not just one-liners, I'm not sure that
> getting rid of the ones that are would help much.
Fair
--
Heikki Linnakangas
Neon (https://neon.tech)
From | Date | Subject | |
---|---|---|---|
Next Message | Nathan Bossart | 2025-03-12 20:04:47 | Re: remove open-coded popcount in acl.c |
Previous Message | Melanie Plageman | 2025-03-12 20:01:59 | Re: BitmapHeapScan streaming read user and prelim refactoring |