v3-0002-Remove-dynahash.h.patch
text/x-diff
Filename: v3-0002-Remove-dynahash.h.patch
Type: text/x-diff
Part: 1
Patch
Format: format-patch
Series: patch v3-0002
Subject: Remove dynahash.h
| File | + | − |
|---|---|---|
| src/backend/utils/hash/dynahash.c | 2 | 2 |
| src/include/utils/dynahash.h | 0 | 20 |
From c6a492debc0d4c74c26f48db18aeeb6d4db8a088 Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@paquier.xyz>
Date: Tue, 9 Sep 2025 12:42:48 +0900
Subject: [PATCH v3 2/2] Remove dynahash.h
All the callers of my_log2() are now limited to dynahash.c, so let's
remove its header. This capability is provided by pg_bitutils.h
already.
---
src/include/utils/dynahash.h | 20 --------------------
src/backend/utils/hash/dynahash.c | 4 ++--
2 files changed, 2 insertions(+), 22 deletions(-)
delete mode 100644 src/include/utils/dynahash.h
diff --git a/src/include/utils/dynahash.h b/src/include/utils/dynahash.h
deleted file mode 100644
index a4362d3f65e5..000000000000
--- a/src/include/utils/dynahash.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * dynahash.h
- * POSTGRES dynahash.h file definitions
- *
- *
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * IDENTIFICATION
- * src/include/utils/dynahash.h
- *
- *-------------------------------------------------------------------------
- */
-#ifndef DYNAHASH_H
-#define DYNAHASH_H
-
-extern int my_log2(int64 num);
-
-#endif /* DYNAHASH_H */
diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c
index 1aeee5be42ac..ac94b9e93c6e 100644
--- a/src/backend/utils/hash/dynahash.c
+++ b/src/backend/utils/hash/dynahash.c
@@ -102,7 +102,6 @@
#include "port/pg_bitutils.h"
#include "storage/shmem.h"
#include "storage/spin.h"
-#include "utils/dynahash.h"
#include "utils/memutils.h"
@@ -281,6 +280,7 @@ static bool init_htab(HTAB *hashp, int64 nelem);
pg_noreturn static void hash_corrupted(HTAB *hashp);
static uint32 hash_initial_lookup(HTAB *hashp, uint32 hashvalue,
HASHBUCKET **bucketptr);
+static int my_log2(int64 num);
static int64 next_pow2_int64(int64 num);
static int next_pow2_int(int64 num);
static void register_seq_scan(HTAB *hashp);
@@ -1813,7 +1813,7 @@ hash_corrupted(HTAB *hashp)
}
/* calculate ceil(log base 2) of num */
-int
+static int
my_log2(int64 num)
{
/*
--
2.51.0