1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Fix GCC 13.2.0 -Wmismatched-new-delete

Table_cache_instance::operator new[](size_t): Reverted the changes
that were made in commit 8edef482a7
and move them to the only caller.
This commit is contained in:
Marko Mäkelä
2023-10-06 08:19:20 +03:00
parent 9e62ab7aaf
commit 10a368d35a

View File

@@ -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);