Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Minor clean-up in dshash.{c,h}.
authorAndres Freund <andres@anarazel.de>
Fri, 2 Mar 2018 00:25:46 +0000 (16:25 -0800)
committerAndres Freund <andres@anarazel.de>
Fri, 2 Mar 2018 00:25:46 +0000 (16:25 -0800)
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

src/backend/lib/dshash.c
src/include/lib/dshash.h

index b1973d4bfbc0fbd2819c778818477383c1256663..b46f7c4cfd0e76b6cf6115202824d7ae6cf0c15a 100644 (file)
@@ -129,7 +129,7 @@ struct dshash_table
 
 /* How many buckets are there in each partition at a given size? */
 #define BUCKETS_PER_PARTITION(size_log2)       \
-   (UINT64CONST(1) << NUM_SPLITS(size_log2))
+   (((size_t) 1) << NUM_SPLITS(size_log2))
 
 /* Max entries before we need to grow.  Half + quarter = 75% load factor. */
 #define MAX_COUNT_PER_PARTITION(hash_table)                \
index afee6516af5b02059e1d45004c4e07359a73e5ef..3f8086e46d699e5614979169873c7a138ab139dc 100644 (file)
@@ -55,7 +55,7 @@ typedef struct dshash_parameters
    int         tranche_id;     /* The tranche ID to use for locks */
 } dshash_parameters;
 
-/* Forward declaration of private types for use only by dht.c. */
+/* Forward declaration of private types for use only by dshash.c. */
 struct dshash_table_item;
 typedef struct dshash_table_item dshash_table_item;