Commit 10a368d3 authored by Marko Mäkelä's avatar Marko Mäkelä

Fix GCC 13.2.0 -Wmismatched-new-delete

Table_cache_instance::operator new[](size_t): Reverted the changes
that were made in commit 8edef482
and move them to the only caller.
parent 9e62ab7a
......@@ -149,15 +149,7 @@ struct Table_cache_instance
}
static void *operator new[](size_t size)
{
void *res= aligned_malloc(size, CPU_LEVEL1_DCACHE_LINESIZE);
if (res)
{
tc_allocated_size= size;
update_malloc_size(size, 0);
}
return res;
}
{ return aligned_malloc(size, CPU_LEVEL1_DCACHE_LINESIZE); }
static void operator delete[](void *ptr) { aligned_free(ptr); }
static void mark_memory_freed()
{
......@@ -614,6 +606,8 @@ bool tdc_init(void)
/* Extra instance is allocated to avoid false sharing */
if (!(tc= new Table_cache_instance[tc_instances + 1]))
DBUG_RETURN(true);
tc_allocated_size= (tc_instances + 1) * sizeof *tc;
update_malloc_size(tc_allocated_size, 0);
tdc_inited= true;
mysql_mutex_init(key_LOCK_unused_shares, &LOCK_unused_shares,
MY_MUTEX_INIT_FAST);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment