mirror of
https://github.com/MariaDB/server.git
synced 2025-08-09 22:24:09 +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:
@@ -149,15 +149,7 @@ struct Table_cache_instance
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void *operator new[](size_t size)
|
static void *operator new[](size_t size)
|
||||||
{
|
{ return aligned_malloc(size, CPU_LEVEL1_DCACHE_LINESIZE); }
|
||||||
void *res= aligned_malloc(size, CPU_LEVEL1_DCACHE_LINESIZE);
|
|
||||||
if (res)
|
|
||||||
{
|
|
||||||
tc_allocated_size= size;
|
|
||||||
update_malloc_size(size, 0);
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
static void operator delete[](void *ptr) { aligned_free(ptr); }
|
static void operator delete[](void *ptr) { aligned_free(ptr); }
|
||||||
static void mark_memory_freed()
|
static void mark_memory_freed()
|
||||||
{
|
{
|
||||||
@@ -614,6 +606,8 @@ bool tdc_init(void)
|
|||||||
/* Extra instance is allocated to avoid false sharing */
|
/* Extra instance is allocated to avoid false sharing */
|
||||||
if (!(tc= new Table_cache_instance[tc_instances + 1]))
|
if (!(tc= new Table_cache_instance[tc_instances + 1]))
|
||||||
DBUG_RETURN(true);
|
DBUG_RETURN(true);
|
||||||
|
tc_allocated_size= (tc_instances + 1) * sizeof *tc;
|
||||||
|
update_malloc_size(tc_allocated_size, 0);
|
||||||
tdc_inited= true;
|
tdc_inited= true;
|
||||||
mysql_mutex_init(key_LOCK_unused_shares, &LOCK_unused_shares,
|
mysql_mutex_init(key_LOCK_unused_shares, &LOCK_unused_shares,
|
||||||
MY_MUTEX_INIT_FAST);
|
MY_MUTEX_INIT_FAST);
|
||||||
|
Reference in New Issue
Block a user