Commit: 0b4da966f9894dc6bf19c337f34f43a3119471cb
Author: Dalai Felinto
Date:   Sun Aug 31 14:44:42 2014 +0200
Branches: master
https://developer.blender.org/rB0b4da966f9894dc6bf19c337f34f43a3119471cb

Bake-API: more MEM_callocN replacements by MEM_mallocN

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D561

===================================================================

M       source/blender/editors/object/object_bake_api.c
M       source/blender/render/intern/source/bake_api.c

===================================================================

diff --git a/source/blender/editors/object/object_bake_api.c 
b/source/blender/editors/object/object_bake_api.c
index fd4db4f..372ca33 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -618,8 +618,8 @@ static int bake(
        }
 
        /* we overallocate in case there is more materials than images */
-       bake_images.data = MEM_callocN(sizeof(BakeImage) * tot_materials, "bake 
images dimensions (width, height, offset)");
-       bake_images.lookup = MEM_callocN(sizeof(int) * tot_materials, "bake 
images lookup (from material to BakeImage)");
+       bake_images.data = MEM_mallocN(sizeof(BakeImage) * tot_materials, "bake 
images dimensions (width, height, offset)");
+       bake_images.lookup = MEM_mallocN(sizeof(int) * tot_materials, "bake 
images lookup (from material to BakeImage)");
 
        build_image_lookup(bmain, ob_low, &bake_images);
 
@@ -676,7 +676,7 @@ static int bake(
                }
        }
 
-       pixel_array_low = MEM_callocN(sizeof(BakePixel) * num_pixels, "bake 
pixels low poly");
+       pixel_array_low = MEM_mallocN(sizeof(BakePixel) * num_pixels, "bake 
pixels low poly");
        result = MEM_callocN(sizeof(float) * depth * num_pixels, "bake return 
pixels");
 
        /* get the mesh as it arrives in the renderer */
@@ -743,10 +743,8 @@ static int bake(
 
                        /* initialize highpoly_data */
                        highpoly[i].ob = ob_iter;
-                       highpoly[i].me = NULL;
-                       highpoly[i].tri_mod = NULL;
                        highpoly[i].restrict_flag = ob_iter->restrictflag;
-                       highpoly[i].pixel_array = MEM_callocN(sizeof(BakePixel) 
* num_pixels, "bake pixels high poly");
+                       highpoly[i].pixel_array = MEM_mallocN(sizeof(BakePixel) 
* num_pixels, "bake pixels high poly");
 
 
                        /* triangulating so BVH returns the primitive_id that 
will be used for rendering */
@@ -1280,7 +1278,7 @@ static int bake_invoke(bContext *C, wmOperator *op, const 
wmEvent *UNUSED(event)
        if (WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_OBJECT_BAKE))
                return OPERATOR_CANCELLED;
 
-       bkr = MEM_callocN(sizeof(BakeAPIRender), "render bake");
+       bkr = MEM_mallocN(sizeof(BakeAPIRender), "render bake");
 
        /* init bake render */
        bake_init_api_data(op, C, bkr);
diff --git a/source/blender/render/intern/source/bake_api.c 
b/source/blender/render/intern/source/bake_api.c
index 6f41175..90deac2 100644
--- a/source/blender/render/intern/source/bake_api.c
+++ b/source/blender/render/intern/source/bake_api.c
@@ -461,7 +461,7 @@ bool RE_bake_pixels_populate_from_objects(
        tris_high = MEM_callocN(sizeof(TriTessFace *) * tot_highpoly, "MVerts 
Highpoly Mesh Array");
 
        /* assume all highpoly tessfaces are triangles */
-       dm_highpoly = MEM_callocN(sizeof(DerivedMesh *) * tot_highpoly, 
"Highpoly Derived Meshes");
+       dm_highpoly = MEM_mallocN(sizeof(DerivedMesh *) * tot_highpoly, 
"Highpoly Derived Meshes");
        treeData = MEM_callocN(sizeof(BVHTreeFromMesh) * tot_highpoly, 
"Highpoly BVH Trees");
 
        if (!is_cage) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to