Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9341c78

Browse files
committed
Put all the prototypes for hashfn.c into the same header file.
Previously, some of the prototypes for functions in hashfn.c werein utils/hashutils.h and others were in utils/hsearch.h, but thatis confusing and has no particular benefit.Patch by me, reviewed by Suraj Kharage and Mark Dilger.Discussion:http://postgr.es/m/CA+TgmoaRiG4TXND8QuM6JXFRkM_1wL2ZNhzaUKsuec9-4yrkgw@mail.gmail.com
1 parent07b95c3 commit9341c78

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

‎src/backend/lib/dshash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include"storage/ipc.h"
3636
#include"storage/lwlock.h"
3737
#include"utils/dsa.h"
38-
#include"utils/hsearch.h"
38+
#include"utils/hashutils.h"
3939
#include"utils/memutils.h"
4040

4141
/*

‎src/backend/utils/hash/dynahash.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
#include"storage/shmem.h"
9090
#include"storage/spin.h"
9191
#include"utils/dynahash.h"
92+
#include"utils/hashutils.h"
9293
#include"utils/memutils.h"
9394

9495

‎src/include/utils/hashutils.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ extern Datum hash_any_extended(const unsigned char *k,
2626
externDatumhash_uint32(uint32k);
2727
externDatumhash_uint32_extended(uint32k,uint64seed);
2828

29+
externuint32string_hash(constvoid*key,Sizekeysize);
30+
externuint32tag_hash(constvoid*key,Sizekeysize);
31+
externuint32uint32_hash(constvoid*key,Sizekeysize);
32+
33+
#defineoid_hash uint32_hash/* Remove me eventually */
34+
2935
/*
3036
* Combine two 32-bit hash values, resulting in another hash value, with
3137
* decent bit mixing.

‎src/include/utils/hsearch.h

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ typedef struct
118118

119119
/*
120120
* prototypes for functions in dynahash.c
121+
*
122+
* Note: It is deprecated for callers of hash_create to explicitly specify
123+
* string_hash, tag_hash, uint32_hash, or oid_hash. Just set HASH_BLOBS or
124+
* not. Use HASH_FUNCTION only when you want something other than those.
121125
*/
122126
externHTAB*hash_create(constchar*tabname,longnelem,
123127
HASHCTL*info,intflags);
@@ -142,17 +146,4 @@ extern Size hash_get_shared_size(HASHCTL *info, int flags);
142146
externvoidAtEOXact_HashTables(boolisCommit);
143147
externvoidAtEOSubXact_HashTables(boolisCommit,intnestDepth);
144148

145-
/*
146-
* prototypes for functions in hashfn.c
147-
*
148-
* Note: It is deprecated for callers of hash_create to explicitly specify
149-
* string_hash, tag_hash, uint32_hash, or oid_hash. Just set HASH_BLOBS or
150-
* not. Use HASH_FUNCTION only when you want something other than those.
151-
*/
152-
externuint32string_hash(constvoid*key,Sizekeysize);
153-
externuint32tag_hash(constvoid*key,Sizekeysize);
154-
externuint32uint32_hash(constvoid*key,Sizekeysize);
155-
156-
#defineoid_hash uint32_hash/* Remove me eventually */
157-
158149
#endif/* HSEARCH_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp