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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, David Zhang <david(dot)zhang(at)highgo(dot)ca>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)
Date: 2022-08-24 19:41:19
Message-ID: CA+TgmoZP1GPBi-_KrP2kaQ27QUGiQNec10S1DhcGUsangdGHQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 24, 2022 at 3:20 PM Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote:
> But, these same arguments apply to Designated Initializers [1].
>
> like:
> struct foo a = {
> .i = 0,
> .b = 0,
> };
>
> That is slowly being introduced and IMHO brings the same problems with padding bits.

Yep. I don't find that an improvement over a MemSet on the struct
either, if we're just using it to fill in zeroes.

If we're using it to fill in non-zero values, though, then there's a
reasonable argument that it offers some notational convenience.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2022-08-24 19:49:59 Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)
Previous Message Ranier Vilela 2022-08-24 19:20:15 Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)