Re: Change GUC hashtable to use simplehash?

From: John Naylor <johncnaylorls(at)gmail(dot)com>
To: "Anton A(dot) Melnikov" <a(dot)melnikov(at)postgrespro(dot)ru>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Ants Aasma <ants(dot)aasma(at)cybertec(dot)at>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Junwang Zhao <zhjwpku(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gurjeet Singh <gurjeet(at)singh(dot)im>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Change GUC hashtable to use simplehash?
Date: 2024-12-19 09:48:27
Message-ID: CANWCAZZjUtfq148s=55L1LKHu+imeKn=iFH5UvgtxRZcCK9fbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:

> The offending code is not even my preferred way to handle the last
> word of the string (see f4ad0021af), so if the current way is still
> not valgrind-clean, I wonder if we should give up and add an
> exception, since we know any garbage bits are masked off.

That would actually be a maintenance headache because the function is
inlined, but here's a better idea: We already have a fallback path for
when the string is not suitably aligned, or in 32-bit builds. We could
just use that under Valgrind:

static inline size_t
fasthash_accum_cstring(fasthash_state *hs, const char *str)
{
-#if SIZEOF_VOID_P >= 8
+#if SIZEOF_VOID_P >= 8 && !defined(USE_VALGRIND)

Any objections?

--
John Naylor
Amazon Web Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yura Sokolov 2024-12-19 10:01:07 Re: Fix bank selection logic in SLRU
Previous Message Richard Guo 2024-12-19 09:15:10 Re: BitmapHeapScan streaming read user and prelim refactoring