| From: | Nathan Bossart <nathandbossart(at)gmail(dot)com> |
|---|---|
| To: | pgsql-hackers(at)postgresql(dot)org |
| Subject: | cleanup patches for dshash |
| Date: | 2024-01-19 21:59:41 |
| Message-ID: | 20240119215941.GA1322079@nathanxps13 |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
While working on the dynamic shared memory registry, I noticed a couple of
potential improvements for code that uses dshash tables.
* A couple of dshash_create() callers pass in 0 for the "void *arg"
parameter, which seemed weird. I incorrectly assumed this was some sort
of flags parameter until I actually looked at the function signature.
IMHO we should specify NULL here if arg is not used. 0001 makes this
change. This is admittedly a nitpick.
* There are no dshash compare/hash functions for string keys. 0002
introduces some that simply forward to strcmp()/string_hash(), and it
uses them for the DSM registry's dshash table. This allows us to remove
the hacky key padding code for lookups on this table.
Thoughts?
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-Use-NULL-instead-of-0-for-arg-parameter-in-dshash.patch | text/x-diff | 1.7 KB |
| v1-0002-Add-hash-compare-functions-for-dshash-tables-with.patch | text/x-diff | 3.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Kirk Wolak | 2024-01-19 22:09:02 | Re: Oom on temp (un-analyzed table caused by JIT) V16.1 [Fixed Already] |
| Previous Message | Melanie Plageman | 2024-01-19 21:43:37 | Re: index prefetching |