Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-12-11 19:10:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-11 19:10:19 +0400
commit71730f26d7c816854a471c9733ad4c10b88fd357 (patch)
tree0201ace6eac1fd2f48ae404bda6ea552cc1259d4 /source/blender/editors
parent3520dd56e3894d2b5c825dc98cdd5d846b6756c0 (diff)
replace BLI_array_fixedstack_declare with() new macro BLI_array_alloca() which uses stack memory always and doesn't need to be freed explicitly.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c9
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c5
2 files changed, 3 insertions, 11 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index f18168a25bf..b7b71be0df9 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -2591,10 +2591,8 @@ static void knife_make_chain_cut(KnifeTool_OpData *kcd, BMFace *f, ListBase *cha
BMLoop *lnew, *l_iter;
int i;
int nco = BLI_countlist(chain) - 1;
- float (*cos)[3] = NULL;
- KnifeVert **kverts;
- BLI_array_fixedstack_declare(cos, BM_DEFAULT_NGON_STACK_SIZE, nco, __func__);
- BLI_array_fixedstack_declare(kverts, BM_DEFAULT_NGON_STACK_SIZE, nco, __func__);
+ float (*cos)[3] = BLI_array_alloca(cos, nco);
+ KnifeVert **kverts = BLI_array_alloca(kverts, nco);
kfe = ((Ref *)chain->first)->ref;
v1 = kfe->v1->v ? kfe->v1->v : kfe->v2->v;
@@ -2643,9 +2641,6 @@ static void knife_make_chain_cut(KnifeTool_OpData *kcd, BMFace *f, ListBase *cha
BM_edge_select_set(bm, lnew->e, TRUE);
}
}
-
- BLI_array_fixedstack_free(cos);
- BLI_array_fixedstack_free(kverts);
}
static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfedges)
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 6e6de03a834..b50b8d466f1 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -1413,8 +1413,7 @@ static void uv_map_mirror(BMEditMesh *em, BMFace *efa, MTexPoly *UNUSED(tf))
BMLoop *l;
BMIter liter;
MLoopUV *luv;
- float **uvs = NULL;
- BLI_array_fixedstack_declare(uvs, BM_DEFAULT_NGON_STACK_SIZE, efa->len, __func__);
+ float **uvs = BLI_array_alloca(uvs, efa->len);
float dx;
int i, mi;
@@ -1436,8 +1435,6 @@ static void uv_map_mirror(BMEditMesh *em, BMFace *efa, MTexPoly *UNUSED(tf))
if (dx > 0.5f) uvs[i][0] += 1.0f;
}
}
-
- BLI_array_fixedstack_free(uvs);
}
static int sphere_project_exec(bContext *C, wmOperator *op)