Re: Can we remove extra memset in BloomInitPage, GinInitPage and SpGistInitPage when we have it in PageInit? - Mailing list pgsql-hackers

From vignesh C
Subject Re: Can we remove extra memset in BloomInitPage, GinInitPage and SpGistInitPage when we have it in PageInit?
Date
Msg-id CALDaNm3Z2bOf=MQrUvDdd=XiSzYFu2=EHou+MR3h8SYj0Jy79w@mail.gmail.com
Whole thread Raw
In response to Can we remove extra memset in BloomInitPage, GinInitPage and SpGistInitPage when we have it in PageInit?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Can we remove extra memset in BloomInitPage, GinInitPage and SpGistInitPage when we have it in PageInit?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On Mon, Mar 22, 2021 at 10:16 AM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
>
> Hi,
>
> We are memset-ting the special space page that's already set to zeros
> by PageInit in BloomInitPage, GinInitPage and SpGistInitPage. We have
> already removed the memset after PageInit in gistinitpage (see the
> comment there).  Unless I'm missing something, IMO they are redundant.
> I'm attaching a small patch that gets rid of the extra memset calls.
>
> While on it, I removed MAXALIGN(sizeof(SpGistPageOpaqueData)) in
> SpGistInitPage because the PageInit will anyways align the
> specialSize. This change is inline with other places (such as
> BloomInitPage, brin_page_init GinInitPage, gistinitpage,
> _hash_pageinit and so on) where we just pass the size of special space
> data structure.
>
> I didn't see any regression test failure on my dev system with the
> attached patch.
>
> Thoughts?

The changes look fine to me.

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: [PATCH] Implement motd for PostgreSQL
Next
From: "Joel Jacobson"
Date:
Subject: Re: [PATCH] Implement motd for PostgreSQL