1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

WL #528: Faster free_tmp_table

This commit is contained in:
unknown
2005-11-06 08:29:03 +01:00
parent efe3703aac
commit 89288fac18
7 changed files with 43 additions and 14 deletions

View File

@ -234,6 +234,16 @@ static void init_block(HP_BLOCK *block, uint reclength, ulong min_records,
HP_PTRS_IN_NOD * block->level_info[i - 1].records_under_level);
}
static inline void heap_try_free(HP_SHARE *share)
{
if (share->open_count == 0)
hp_free(share);
else
share->delete_on_close= 1;
}
int heap_delete_table(const char *name)
{
int result;
@ -243,10 +253,7 @@ int heap_delete_table(const char *name)
pthread_mutex_lock(&THR_LOCK_heap);
if ((share= hp_find_named_heap(name)))
{
if (share->open_count == 0)
hp_free(share);
else
share->delete_on_close= 1;
heap_try_free(share);
result= 0;
}
else
@ -257,6 +264,17 @@ int heap_delete_table(const char *name)
DBUG_RETURN(result);
}
void heap_drop_table(HP_INFO *info)
{
DBUG_ENTER("heap_drop_table");
pthread_mutex_lock(&THR_LOCK_heap);
heap_try_free(info->s);
pthread_mutex_unlock(&THR_LOCK_heap);
DBUG_VOID_RETURN;
}
void hp_free(HP_SHARE *share)
{
heap_share_list= list_delete(heap_share_list, &share->open_list);