Browse Source

Remove dead support for changing BDB hash algorithm and cache of alternatives

ok natano@ millert@ deraadt@
OPENBSD_6_0
guenther 8 years ago
parent
commit
05aa77af36
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      src/lib/libc/stdlib/hcreate.c

+ 4
- 5
src/lib/libc/stdlib/hcreate.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: hcreate.c,v 1.6 2015/09/10 18:13:46 guenther Exp $ */
/* $OpenBSD: hcreate.c,v 1.7 2016/05/29 20:47:49 guenther Exp $ */
/* $NetBSD: hcreate.c,v 1.5 2004/04/23 02:48:12 simonb Exp $ */ /* $NetBSD: hcreate.c,v 1.5 2004/04/23 02:48:12 simonb Exp $ */
/* /*
@ -55,6 +55,8 @@
#include <string.h> #include <string.h>
#include <sys/queue.h> #include <sys/queue.h>
#include <db.h> /* for __default_hash */
#ifndef _DIAGASSERT #ifndef _DIAGASSERT
#define _DIAGASSERT(x) #define _DIAGASSERT(x)
#endif #endif
@ -79,9 +81,6 @@ SLIST_HEAD(internal_head, internal_entry);
#define MAX_BUCKETS_LG2 (sizeof (size_t) * 8 - 1 - 5) #define MAX_BUCKETS_LG2 (sizeof (size_t) * 8 - 1 - 5)
#define MAX_BUCKETS ((size_t)1 << MAX_BUCKETS_LG2) #define MAX_BUCKETS ((size_t)1 << MAX_BUCKETS_LG2)
/* Default hash function, from db/hash/hash_func.c */
extern u_int32_t (*__default_hash)(const void *, size_t);
static struct internal_head *htable; static struct internal_head *htable;
static size_t htablesize; static size_t htablesize;
@ -164,7 +163,7 @@ hsearch(ENTRY item, ACTION action)
_DIAGASSERT(action == ENTER || action == FIND); _DIAGASSERT(action == ENTER || action == FIND);
len = strlen(item.key); len = strlen(item.key);
hashval = (*__default_hash)(item.key, len);
hashval = __default_hash(item.key, len);
head = &htable[hashval & (htablesize - 1)]; head = &htable[hashval & (htablesize - 1)];
ie = SLIST_FIRST(head); ie = SLIST_FIRST(head);


Loading…
Cancel
Save