Skip to content

Commit 17b340a

Browse files
committed
Minor clean-up in dshash.{c,h}.
For consistency with other code that deals in numbers of buckets, the macro BUCKETS_PER_PARTITION should produce a value of type size_t. Also, fix a mention of an obsolete proposed name for dshash.c that appeared in a comment. Author: Thomas Munro, based on an observation from Amit Kapila Discussion: https://postgr.es/m/CAA4eK1%2BBOp5aaW3aHEkg5Bptf8Ga_BkBnmA-%3DXcAXShs0yCiYQ%40mail.gmail.com
1 parent 07c6e51 commit 17b340a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/lib/dshash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ struct dshash_table
129129

130130
/* How many buckets are there in each partition at a given size? */
131131
#define BUCKETS_PER_PARTITION(size_log2) \
132-
(UINT64CONST(1) << NUM_SPLITS(size_log2))
132+
(((size_t) 1) << NUM_SPLITS(size_log2))
133133

134134
/* Max entries before we need to grow. Half + quarter = 75% load factor. */
135135
#define MAX_COUNT_PER_PARTITION(hash_table) \

src/include/lib/dshash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ typedef struct dshash_parameters
5555
int tranche_id; /* The tranche ID to use for locks */
5656
} dshash_parameters;
5757

58-
/* Forward declaration of private types for use only by dht.c. */
58+
/* Forward declaration of private types for use only by dshash.c. */
5959
struct dshash_table_item;
6060
typedef struct dshash_table_item dshash_table_item;
6161

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy