diff options
author | guenther <> | 2016-05-29 20:47:49 +0000 |
---|---|---|
committer | guenther <> | 2016-05-29 20:47:49 +0000 |
commit | 3b027489eb0e5a417e1aaba2951a27fcea37cfcb (patch) | |
tree | 6d09085774d2ad03bb546358c0651baebd387780 /src/lib | |
parent | d608cd277aa57b91a3a9f23a0e0d655c1d951d64 (diff) | |
download | openbsd-3b027489eb0e5a417e1aaba2951a27fcea37cfcb.tar.gz openbsd-3b027489eb0e5a417e1aaba2951a27fcea37cfcb.tar.bz2 openbsd-3b027489eb0e5a417e1aaba2951a27fcea37cfcb.zip |
Remove dead support for changing BDB hash algorithm and cache of alternatives
ok natano@ millert@ deraadt@
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libc/stdlib/hcreate.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/libc/stdlib/hcreate.c b/src/lib/libc/stdlib/hcreate.c index cb547a8d36..b31108a90e 100644 --- a/src/lib/libc/stdlib/hcreate.c +++ b/src/lib/libc/stdlib/hcreate.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: hcreate.c,v 1.6 2015/09/10 18:13:46 guenther Exp $ */ | 1 | /* $OpenBSD: hcreate.c,v 1.7 2016/05/29 20:47:49 guenther Exp $ */ |
2 | /* $NetBSD: hcreate.c,v 1.5 2004/04/23 02:48:12 simonb Exp $ */ | 2 | /* $NetBSD: hcreate.c,v 1.5 2004/04/23 02:48:12 simonb Exp $ */ |
3 | 3 | ||
4 | /* | 4 | /* |
@@ -55,6 +55,8 @@ | |||
55 | #include <string.h> | 55 | #include <string.h> |
56 | #include <sys/queue.h> | 56 | #include <sys/queue.h> |
57 | 57 | ||
58 | #include <db.h> /* for __default_hash */ | ||
59 | |||
58 | #ifndef _DIAGASSERT | 60 | #ifndef _DIAGASSERT |
59 | #define _DIAGASSERT(x) | 61 | #define _DIAGASSERT(x) |
60 | #endif | 62 | #endif |
@@ -79,9 +81,6 @@ SLIST_HEAD(internal_head, internal_entry); | |||
79 | #define MAX_BUCKETS_LG2 (sizeof (size_t) * 8 - 1 - 5) | 81 | #define MAX_BUCKETS_LG2 (sizeof (size_t) * 8 - 1 - 5) |
80 | #define MAX_BUCKETS ((size_t)1 << MAX_BUCKETS_LG2) | 82 | #define MAX_BUCKETS ((size_t)1 << MAX_BUCKETS_LG2) |
81 | 83 | ||
82 | /* Default hash function, from db/hash/hash_func.c */ | ||
83 | extern u_int32_t (*__default_hash)(const void *, size_t); | ||
84 | |||
85 | static struct internal_head *htable; | 84 | static struct internal_head *htable; |
86 | static size_t htablesize; | 85 | static size_t htablesize; |
87 | 86 | ||
@@ -164,7 +163,7 @@ hsearch(ENTRY item, ACTION action) | |||
164 | _DIAGASSERT(action == ENTER || action == FIND); | 163 | _DIAGASSERT(action == ENTER || action == FIND); |
165 | 164 | ||
166 | len = strlen(item.key); | 165 | len = strlen(item.key); |
167 | hashval = (*__default_hash)(item.key, len); | 166 | hashval = __default_hash(item.key, len); |
168 | 167 | ||
169 | head = &htable[hashval & (htablesize - 1)]; | 168 | head = &htable[hashval & (htablesize - 1)]; |
170 | ie = SLIST_FIRST(head); | 169 | ie = SLIST_FIRST(head); |