Core: Test/demo usage of new MEM_mallocN<T> template functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/135531
This commit is contained in:
Bastien Montagne
2025-03-05 19:05:58 +01:00
committed by Gitea
parent 2900cfa50a
commit 514ed4113f
2 changed files with 2 additions and 3 deletions

View File

@@ -1513,7 +1513,7 @@ UserDef *BKE_blendfile_userdef_from_defaults()
/* Theme. */
{
bTheme *btheme = static_cast<bTheme *>(MEM_mallocN(sizeof(*btheme), __func__));
bTheme *btheme = MEM_mallocN<bTheme>(__func__);
memcpy(btheme, &U_theme_default, sizeof(*btheme));
BLI_addtail(&userdef->themes, btheme);

View File

@@ -4006,8 +4006,7 @@ static void sort_bhead_old_map(FileData *fd)
return;
}
bhs = fd->bheadmap = static_cast<BHeadSort *>(
MEM_malloc_arrayN(tot, sizeof(BHeadSort), "BHeadSort"));
bhs = fd->bheadmap = MEM_malloc_arrayN<BHeadSort>(tot, "BHeadSort");
for (bhead = blo_bhead_first(fd); bhead; bhead = blo_bhead_next(fd, bhead), bhs++) {
bhs->bhead = bhead;