Re: Remove freelist reference in buf_init.c - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: Remove freelist reference in buf_init.c
Date
Msg-id CAExHW5v76oi-ZKB8k_7r5TRT9Bic76dfBXPE3hVVASK7ce1NLQ@mail.gmail.com
Whole thread Raw
In response to Re: Remove freelist reference in buf_init.c  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Tue, Feb 3, 2026 at 8:44 PM Andres Freund <andres@anarazel.de> wrote:
>
> Hi,
>
> On 2026-02-03 10:48:30 +0530, Ashutosh Bapat wrote:
> > We have gotten rid of freelist in buffer manager, but buf_init.c still
> > has a reference to it in a comment. Patch to remove the reference.
> >
> > Other references to freelist refer to freelist.c which is still a
> > valid filename reference. Hence I didn't touch it.
>
> I'm not sure this enough of an improvement to really be worth it. I think we
> probably ought to rename freelist.c to buf_replacement.c or such.  Which of
> course will require more comment changes.
>
> Even if we don't, I think that the entire comment in buf_init.c is misplaced
> and bound to not be updated. Nobody is looking for it there, both when trying
> to learn about the code and when changing the code.

Hmm,
I think that whole comment block is misleading; it seems to be
outdated or at least incomplete. We have two options
1. Replace the comment block with a comment block mentioning all the
shared memory structures that buffer manager uses, their purpose, and
point to respective comments in buf_internals.h.
2. Remove that comment entirely from there and add the comment block
as above to README.

--
Best Wishes,
Ashutosh Bapat



pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Use allocation macros in the logical replication code
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Proposal: pg_createsubscriber use without superuser privileges