diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-12 16:06:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-12 16:06:08 +0400 |
commit | 85145db47be6a4b117142ca5370ed0e10104a5cb (patch) | |
tree | 2bd6317e00fb929c4ed86d13641237df14ea0fca /source/blender/bmesh/operators/bmo_utils.c | |
parent | 60f88c94c1e31bfeb77c53a9b64913224544062d (diff) |
remove wanton use of array reallocation for mesh smoothing.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_utils.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_utils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index af96b62e074..7e86c0a52ea 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -420,8 +420,7 @@ void bmo_smooth_vert_exec(BMesh *UNUSED(bm), BMOperator *op) BMIter iter; BMVert *v; BMEdge *e; - BLI_array_declare(cos); - float (*cos)[3] = NULL; + float (*cos)[3] = MEM_mallocN(sizeof(*cos) * BMO_slot_buffer_count(op->slots_in, "verts"), __func__); float *co, *co2, clip_dist = BMO_slot_float_get(op->slots_in, "clip_dist"); int i, j, clipx, clipy, clipz; int xaxis, yaxis, zaxis; @@ -436,7 +435,6 @@ void bmo_smooth_vert_exec(BMesh *UNUSED(bm), BMOperator *op) i = 0; BMO_ITER (v, &siter, op->slots_in, "verts", BM_VERT) { - BLI_array_grow_one(cos); co = cos[i]; zero_v3(co); @@ -479,7 +477,7 @@ void bmo_smooth_vert_exec(BMesh *UNUSED(bm), BMOperator *op) i++; } - BLI_array_free(cos); + MEM_freeN(cos); } /**************************************************************************** * |