Re: Change GUC hashtable to use simplehash? - Mailing list pgsql-hackers

From John Naylor
Subject Re: Change GUC hashtable to use simplehash?
Date
Msg-id CANWCAZZjUtfq148s=55L1LKHu+imeKn=iFH5UvgtxRZcCK9fbg@mail.gmail.com
Whole thread Raw
In response to Re: Change GUC hashtable to use simplehash?  (John Naylor <johncnaylorls@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: BitmapHeapScan streaming read user and prelim refactoring
Next
From: Yura Sokolov
Date:
Subject: Re: Fix bank selection logic in SLRU