diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-03-04 23:54:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-04 23:59:34 +0300 |
commit | a297a6c444c7463295f0447a55a5f9542414529c (patch) | |
tree | 964875831032df99b2625c4748992c70ddb7231f /source/blender/makesrna | |
parent | a5c4a44df67ed69844a433179629d861cf10f438 (diff) |
Cleanup: replace unnecessary MEM_callocN calls
Use MEM_mallocN when memory is immediately copied over.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_animation.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index e1a24326474..9aafdb02f69 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -332,7 +332,7 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, } /* create a new KeyingSetInfo type */ - ksi = MEM_callocN(sizeof(KeyingSetInfo), "python keying set info"); + ksi = MEM_mallocN(sizeof(KeyingSetInfo), "python keying set info"); memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo)); /* set RNA-extensions info */ diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index e5445546491..cd2b0cb97dd 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -816,7 +816,7 @@ static StructRNA *rna_NodeTree_register(Main *bmain, } /* create a new node tree type */ - nt = MEM_callocN(sizeof(bNodeTreeType), "node tree type"); + nt = MEM_mallocN(sizeof(bNodeTreeType), "node tree type"); memcpy(nt, &dummynt, sizeof(dummynt)); nt->type = NTREE_CUSTOM; @@ -1650,7 +1650,7 @@ static bNodeType *rna_Node_register_base(Main *bmain, } /* create a new node type */ - nt = MEM_callocN(sizeof(bNodeType), "node type"); + nt = MEM_mallocN(sizeof(bNodeType), "node type"); memcpy(nt, &dummynt, sizeof(dummynt)); nt->free_self = (void (*)(bNodeType *))MEM_freeN; @@ -2178,7 +2178,7 @@ static StructRNA *rna_NodeSocket_register(Main *UNUSED(bmain), st = nodeSocketTypeFind(dummyst.idname); if (!st) { /* create a new node socket type */ - st = MEM_callocN(sizeof(bNodeSocketType), "node socket type"); + st = MEM_mallocN(sizeof(bNodeSocketType), "node socket type"); memcpy(st, &dummyst, sizeof(dummyst)); nodeRegisterSocketType(st); @@ -2494,7 +2494,7 @@ static StructRNA *rna_NodeSocketInterface_register(Main *UNUSED(bmain), } else { /* create a new node socket type */ - st = MEM_callocN(sizeof(bNodeSocketType), "node socket type"); + st = MEM_mallocN(sizeof(bNodeSocketType), "node socket type"); memcpy(st, &dummyst, sizeof(dummyst)); nodeRegisterSocketType(st); diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 2031c444c9a..2f64740830b 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -351,7 +351,7 @@ static StructRNA *rna_RenderEngine_register(Main *bmain, } /* create a new engine type */ - et = MEM_callocN(sizeof(RenderEngineType), "python render engine"); + et = MEM_mallocN(sizeof(RenderEngineType), "python render engine"); memcpy(et, &dummyet, sizeof(dummyet)); et->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, et->idname, &RNA_RenderEngine); diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index a7f0c8ff19c..778e65d3276 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -341,7 +341,7 @@ static StructRNA *rna_Panel_register(Main *bmain, } /* create a new panel type */ - pt = MEM_callocN(sizeof(PanelType), "python buttons panel"); + pt = MEM_mallocN(sizeof(PanelType), "python buttons panel"); memcpy(pt, &dummypt, sizeof(dummypt)); pt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, pt->idname, &RNA_Panel); @@ -775,7 +775,7 @@ static StructRNA *rna_Header_register(Main *bmain, } /* create a new header type */ - ht = MEM_callocN(sizeof(HeaderType), "python buttons header"); + ht = MEM_mallocN(sizeof(HeaderType), "python buttons header"); memcpy(ht, &dummyht, sizeof(dummyht)); ht->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, ht->idname, &RNA_Header); |