From 5e7733bc18c0726142dab8dc86a3f173230b0d4d Mon Sep 17 00:00:00 2001 From: Mikael Ronstrom Date: Fri, 9 Oct 2009 14:22:22 +0200 Subject: A minor change to MySQL's hash where calculation of hash can be done separately to avoid doing it under contended mutex locks --- include/hash.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/hash.h') diff --git a/include/hash.h b/include/hash.h index 629b404e8a7..b6fc365ab76 100644 --- a/include/hash.h +++ b/include/hash.h @@ -45,6 +45,7 @@ extern "C" { #define hash_element my_hash_element #define hash_search my_hash_search #define hash_first my_hash_first +#define hash_first_from_hash_value my_hash_first_from_hash_value #define hash_next my_hash_next #define hash_insert my_hash_insert #define hash_delete my_hash_delete @@ -94,8 +95,16 @@ void my_hash_free(HASH *tree); void my_hash_reset(HASH *hash); uchar *my_hash_element(HASH *hash, ulong idx); uchar *my_hash_search(const HASH *info, const uchar *key, size_t length); +uchar *my_hash_search_using_hash_value(const HASH *info, uint hash_value, + const uchar *key, size_t length); +uint my_calc_hash(const HASH *info, const uchar *key, size_t length); uchar *my_hash_first(const HASH *info, const uchar *key, size_t length, HASH_SEARCH_STATE *state); +uchar *my_hash_first_from_hash_value(const HASH *info, + uint hash_value, + const uchar *key, + size_t length, + HASH_SEARCH_STATE *state); uchar *my_hash_next(const HASH *info, const uchar *key, size_t length, HASH_SEARCH_STATE *state); my_bool my_hash_insert(HASH *info, const uchar *data); -- cgit v1.2.1