Skip to content

Commit 957075d

Browse files
author
Sergey Shinderuk
committed
Pass HASH_BLOBS to hash_create() instead of expicit tag_hash
As per hash_create docs: > Note: It is deprecated for callers of hash_create() to explicitly specify > string_hash, tag_hash, uint32_hash, or oid_hash. Just set HASH_STRINGS or > HASH_BLOBS. Use HASH_FUNCTION only when you want something other than > one of these. Also there is no need to explicitly specify TopMemoryContext as it is used by default.
1 parent 09463b6 commit 957075d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

collector.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include <signal.h>
1313

14-
#include "common/hashfn.h"
1514
#include "compat.h"
1615
#include "miscadmin.h"
1716
#include "pg_wait_sampling.h"
@@ -288,17 +287,14 @@ make_profile_hash()
288287
{
289288
HASHCTL hash_ctl;
290289

291-
hash_ctl.hash = tag_hash;
292-
hash_ctl.hcxt = TopMemoryContext;
293-
294290
if (pgws_profileQueries)
295291
hash_ctl.keysize = offsetof(ProfileItem, count);
296292
else
297293
hash_ctl.keysize = offsetof(ProfileItem, queryId);
298294

299295
hash_ctl.entrysize = sizeof(ProfileItem);
300296
return hash_create("Waits profile hash", 1024, &hash_ctl,
301-
HASH_FUNCTION | HASH_ELEM);
297+
HASH_ELEM | HASH_BLOBS);
302298
}
303299

304300
/*

0 commit comments

Comments
 (0)