Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, David Zhang <david.zhang@highgo.ca>, Ranier Vilela <ranier.vf@gmail.com>, Justin Pryzby <pryzby@telsasoft.com>, David Rowley <dgrowleyml@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2022-08-24T19:19:35Z
Lists: pgsql-hackers
On Wed, Aug 24, 2022 at 3:00 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Call me a trogdolyte, but I don't follow how it's an improvement.
> It looks to me like an entirely random change that doesn't get rid
> of assumptions about what the bits are, it just replaces one set of
> assumptions with a different set.  Moreover, the new set of assumptions
> may include "there are no padding bits in here", which is mighty fragile
> and hard to verify.  So I frankly do not find this a stylistic improvement.

Ditto.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



Commits

  1. Replace many MemSet calls with struct initialization

  2. Change some unnecessary MemSet calls

  3. Avoid unnecessary MemSet call