Re: simplehash.h: "SH_SCOPE static" causes warnings

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: simplehash.h: "SH_SCOPE static" causes warnings
Дата
Msg-id db9edf4a83098928b9bbf29bce2f1796ace9c86d.camel@j-davis.com
обсуждение исходный текст
Ответ на Re: simplehash.h: "SH_SCOPE static" causes warnings  (Andres Freund <andres@anarazel.de>)
Ответы Re: simplehash.h: "SH_SCOPE static" causes warnings  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi,

On Tue, 2024-04-09 at 11:56 -0700, Andres Freund wrote:
> FWIW, with just about any modern-ish compiler just using "inline"
> doesn't
> actually force inlining, it just changes the cost model to make it
> more
> likely.

OK.

In the linked thread, I didn't see a good reason to encourage the
compiler to inline the code. Only one caller uses the hash table, so my
instinct would be that the code for maniuplating it should not be
inlined. But "extern" (which is the scope now) is certainly not right,
so "static" made the most sense to me.

>
> I'm not opposed. I'd however at least add a comment explaining why
> this is
> being used. Arguably it doesn't make sense to add it to *_create(),
> as without
> that there really isn't a point in having a simplehash instantiation.
> Might
> make it slightly easier to notice obsoleted uses of simplehash.

That's a good idea that preserves some utility for the warnings.

Should I go ahead and commit something like that now, or hold it until
the other thread concludes, or hold it until the July CF?

Regards,
    Jeff Davis




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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: simplehash.h: "SH_SCOPE static" causes warnings
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: WIP Incremental JSON Parser