Re: Elimination of the repetitive code at the SLRU bootstrap functions.

Evgeny Voropaev <evgeny.voropaev@tantorlabs.com>

From: Evgeny Voropaev <evgeny.voropaev@tantorlabs.com>
To: aleksander@timescale.com, pgsql-hackers@postgresql.org, alvherre@alvh.no-ip.org
Date: 2025-02-14T06:54:06Z
Lists: pgsql-hackers

Attachments

Hello Aleksander!
Hello Álvaro!
Thank you for your attention to the patch.

> Since BootStrapSlruPage() is the only caller of ZeroPage() it seems to
> me that it merely wastes space in SlruCtlData. On top of that I'm not
> 100% sure if all the supported platforms have C99 compilers with
> designated initializers support.

> Wouldn't it be simpler to pass the callback straight to
> BootStrapSlruPage()?

I agree with your proposals. Moreover, similar solution is also implemented and exploited at
Tantor's versions of the xid64 patch (https://www.postgresql.org/message-id/5ca56aed-dc69-4c3e-968f-a822ae0937b5%40gmail.com).

The corrected patch version implementing these proposals is attached.

Best regards,
Evgeny Voropaev,
Tantor Labs LLC.