Re: Elimination of the repetitive code at the SLRU bootstrap functions. - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: Elimination of the repetitive code at the SLRU bootstrap functions.
Date
Msg-id BA4E87E0-8120-413F-A36D-71C5DB217ADD@yandex-team.ru
Whole thread Raw
In response to Re: Elimination of the repetitive code at the SLRU bootstrap functions.  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: Elimination of the repetitive code at the SLRU bootstrap functions.
List pgsql-hackers

> On 14 Feb 2025, at 11:54, Evgeny Voropaev <evgeny.voropaev@tantorlabs.com> wrote:
>
> <v2-0001-Elimination-of-the-repetitive-code-at-the-SLRU-bo.patch>

Hi! Nice patch!

BootStrapSlruPage() always calls zerofunc(pageno, false) with second argument false.
In case of every possible argument (ZeroCLOGPage, ZeroCommitTsPage, ZeroMultiXactOffsetPage, ZeroMultiXactMemberPage,
ZeroSUBTRANSPage)it means just a call to SimpleLruZeroPage(). 
I think we can safely replace

+ slotno = (*zerofunc)(pageno, false);

with

+ slotno = SimpleLruZeroPage(pageno);

Thus we will not need zerofunc argument at all.

Thanks!


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Maksim Korotkov
Date:
Subject: Re: [PATCH] snowball: fix potential NULL dereference
Next
From: Álvaro Herrera
Date:
Subject: Re: Elimination of the repetitive code at the SLRU bootstrap functions.