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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user