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

cleanup: thd->alloc<>() and thd->calloc<>()

create templates

  thd->alloc<X>(n) to use instead of (X*)thd->alloc(sizeof(X)*n)

and the same for thd->calloc(). By the default the type is char,
so old usage of thd->alloc(size) works too.
This commit is contained in:
Sergei Golubchik
2024-06-01 16:15:53 +02:00
parent eff16d7593
commit 44c6328cbb
63 changed files with 262 additions and 362 deletions

View File

@@ -949,7 +949,7 @@ retry:
{
DBUG_ASSERT(keyname != 0);
if (unlikely(!(key= (uchar*) thd->calloc(ALIGN_SIZE(handler->key_len)))))
if (unlikely(!(key= thd->calloc<uchar>(ALIGN_SIZE(handler->key_len)))))
goto err;
if (unlikely((error= table->file->ha_index_or_rnd_end())))
break;