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

From Bharath Rupireddy
Subject Re: Can we remove extra memset in BloomInitPage, GinInitPage and SpGistInitPage when we have it in PageInit?
Date
Msg-id CALj2ACWOd9SWykgazp0NNyjy-R++m5=u=b3XWmaU547aTVNGiQ@mail.gmail.com
Whole thread Raw
In response to Re: Can we remove extra memset in BloomInitPage, GinInitPage and SpGistInitPage when we have it in PageInit?  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Can we remove extra memset in BloomInitPage, GinInitPage and SpGistInitPage when we have it in PageInit?  (Pavel Borisov <pashkin.elfe@gmail.com>)
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 Wed, Apr 7, 2021 at 11:44 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Wed, Apr 07, 2021 at 06:31:19AM +0530, Bharath Rupireddy wrote:
> > Setting p->pd_flags = 0; is unnecessary and redundant after memsetting
> > the page to zeros. Also, see the existing code for pd_prune_xid,
> > similarly I've done that for pd_flags. I think it's okay with /*
> > p->pd_flags = 0;        done by above MemSet */.
>
> Sure, but this one does not hurt much either as-is, so I have left it
> out, and applied the rest.

Thanks for pushing the patch.

I wanted to comment out p->pd_flags = 0; in PageInit similar to the
pd_prune_xid just for consistency.
    /* p->pd_prune_xid = InvalidTransactionId;        done by above MemSet */

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: buildfarm instance bichir stuck
Next
From: Peter Smith
Date:
Subject: Re: [HACKERS] logical decoding of two-phase transactions