diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-09 15:42:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-09 15:42:24 +0400 |
commit | 2e0f741d0190d60243d8ace131ffcd7f3b620f63 (patch) | |
tree | 2a618c710b9349edcb8584aeb9b4688e16ce8939 /source/blender/editors/mesh/editmesh_utils.c | |
parent | 278240f4b0c76194ddbc0e420864d7a3206cef05 (diff) |
can't use alloca in inline functions (fills up stack - I thought compiler would be smart here).
also reserve the exact number of vert/face/edge/loops when creating a bmesh during undo.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_utils.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index c2263fc8cf5..719c7ab95e3 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -639,11 +639,16 @@ static void undoMesh_to_editbtMesh(void *umv, void *em_v, void *UNUSED(obdata)) UndoMesh *um = umv; BMesh *bm; + const BMAllocTemplate allocsize = {um->me.totvert, + um->me.totedge, + um->me.totloop, + um->me.totpoly}; + ob->shapenr = em->bm->shapenr = um->shapenr; EDBM_mesh_free(em); - bm = BM_mesh_create(&bm_mesh_allocsize_default); + bm = BM_mesh_create(&allocsize); BM_mesh_bm_from_me(bm, &um->me, false, ob->shapenr); |