summaryrefslogtreecommitdiff
path: root/mysys/mf_keycaches.c
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-10-14 20:37:38 +0400
committerKonstantin Osipov <kostja@sun.com>2009-10-14 20:37:38 +0400
commit9b41c7532d18b04d2f430932ad916886c77fbff6 (patch)
treef4b1025df0074aacaf5f04f64aac370a80806ee1 /mysys/mf_keycaches.c
parent2b75d952e68375eb1727040074266bbe1b436653 (diff)
downloadmariadb-git-9b41c7532d18b04d2f430932ad916886c77fbff6.tar.gz
Backport of:
---------------------------------------------------------- revno: 2617.22.5 committer: Konstantin Osipov <kostja@sun.com> branch nick: mysql-6.0-runtime timestamp: Tue 2009-01-27 05:08:48 +0300 message: Remove non-prefixed use of HASH. Always use my_hash_init(), my_hash_inited(), my_hash_search(), my_hash_element(), my_hash_delete(), my_hash_free() rather than non-prefixed counterparts (hash_init(), etc). Remove the backward-compatible defines.
Diffstat (limited to 'mysys/mf_keycaches.c')
-rw-r--r--mysys/mf_keycaches.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c
index 6227a05ce06..999e8cc7975 100644
--- a/mysys/mf_keycaches.c
+++ b/mysys/mf_keycaches.c
@@ -108,9 +108,9 @@ static my_bool safe_hash_init(SAFE_HASH *hash, uint elements,
uchar *default_value)
{
DBUG_ENTER("safe_hash");
- if (hash_init(&hash->hash, &my_charset_bin, elements,
- 0, 0, (hash_get_key) safe_hash_entry_get,
- (void (*)(void*)) safe_hash_entry_free, 0))
+ if (my_hash_init(&hash->hash, &my_charset_bin, elements,
+ 0, 0, (my_hash_get_key) safe_hash_entry_get,
+ (void (*)(void*)) safe_hash_entry_free, 0))
{
hash->default_value= 0;
DBUG_RETURN(1);
@@ -137,7 +137,7 @@ static void safe_hash_free(SAFE_HASH *hash)
*/
if (hash->default_value)
{
- hash_free(&hash->hash);
+ my_hash_free(&hash->hash);
rwlock_destroy(&hash->mutex);
hash->default_value=0;
}
@@ -152,7 +152,7 @@ static uchar *safe_hash_search(SAFE_HASH *hash, const uchar *key, uint length)
uchar *result;
DBUG_ENTER("safe_hash_search");
rw_rdlock(&hash->mutex);
- result= hash_search(&hash->hash, key, length);
+ result= my_hash_search(&hash->hash, key, length);
rw_unlock(&hash->mutex);
if (!result)
result= hash->default_value;
@@ -192,7 +192,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length,
DBUG_PRINT("enter",("key: %.*s data: 0x%lx", length, key, (long) data));
rw_wrlock(&hash->mutex);
- entry= (SAFE_HASH_ENTRY*) hash_search(&hash->hash, key, length);
+ entry= (SAFE_HASH_ENTRY*) my_hash_search(&hash->hash, key, length);
if (data == hash->default_value)
{
@@ -206,7 +206,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length,
/* unlink entry from list */
if ((*entry->prev= entry->next))
entry->next->prev= entry->prev;
- hash_delete(&hash->hash, (uchar*) entry);
+ my_hash_delete(&hash->hash, (uchar*) entry);
goto end;
}
if (entry)
@@ -277,7 +277,7 @@ static void safe_hash_change(SAFE_HASH *hash, uchar *old_data, uchar *new_data)
{
if ((*entry->prev= entry->next))
entry->next->prev= entry->prev;
- hash_delete(&hash->hash, (uchar*) entry);
+ my_hash_delete(&hash->hash, (uchar*) entry);
}
else
entry->data= new_data;