Re: PgStat_HashKey padding issue when passed by reference

Поиск
Список
Период
Сортировка
От Sami Imseih
Тема Re: PgStat_HashKey padding issue when passed by reference
Дата
Msg-id CAA5RZ0sOkyubFPJzZ_Sv4sdBV89C6WTDAc-B8ZE_-bTk8ggViA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PgStat_HashKey padding issue when passed by reference  (Andres Freund <andres@anarazel.de>)
Ответы Re: PgStat_HashKey padding issue when passed by reference
Список pgsql-hackers
> > This looks like a compiler bug, we tested multiple ways to workaround:
>
> Padding bytes aren't guaranteed to be zeroed, unless you take care to zero
> them out with memset or such. That's not a compiler bug.

Perhaps calling this a compiler bug is not appropriate.
However, memset is in fact called when the key is created

```
  /* clear padding */
  memset(&key, 0, sizeof(struct PgStat_HashKey));
```

but the zeroed out padding bytes are not retained when the
key is passed by value. This is why the proposal is to pass the
key by reference.

--
Sami Imseih
Amazon Web Services (AWS)



В списке pgsql-hackers по дате отправления: