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

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)
Date: 2022-05-18 13:52:15
Message-ID: 862071f2-0c72-7b4b-42e5-609c75731aed@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18.05.22 01:18, Justin Pryzby wrote:
> Take the first one as an example. It says:
>
> GenericCosts costs;
> MemSet(&costs, 0, sizeof(costs));
>
> You sent a patch to change it to sizeof(GenericCosts).
>
> But it's not a pointer, so they are the same.

This instance can more easily be written as

costs = {0};

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2022-05-18 14:08:08 Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)
Previous Message Peter Eisentraut 2022-05-18 13:30:26 Re: Minor improvements to test log navigability