diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-02 02:17:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-02 02:17:04 +0400 |
commit | 921a7556fbc4c66267137b767ce93c85d9b4cbd8 (patch) | |
tree | 7d816ba9696338c219d18ac4d6f7e3b1f536ebf6 /source/blender/bmesh/operators/bmo_mesh_conv.c | |
parent | 2942eab57c9677e87d0830fe5e5da35abb869417 (diff) |
bmesh - changes to mempool allocations
* double default edge allocation size (double the number of verts/faces).
* CustomData_bmesh_init_pool was using allocsize & chunksize as the same variable. Now use type specific chunk size.
* bmesh copy and editmode conversion now allocate the BMesh mempool size needed for the entire vert/edge/loop/face arrays since its known already.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_mesh_conv.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_mesh_conv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/bmesh/operators/bmo_mesh_conv.c b/source/blender/bmesh/operators/bmo_mesh_conv.c index 9cab8cd5f91..ddec92e5754 100644 --- a/source/blender/bmesh/operators/bmo_mesh_conv.c +++ b/source/blender/bmesh/operators/bmo_mesh_conv.c @@ -137,10 +137,10 @@ void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) printf("shapekey <-> mesh mismatch!\n"); } - CustomData_bmesh_init_pool(&bm->vdata, bm_mesh_allocsize_default.totvert); - CustomData_bmesh_init_pool(&bm->edata, bm_mesh_allocsize_default.totedge); - CustomData_bmesh_init_pool(&bm->ldata, bm_mesh_allocsize_default.totloop); - CustomData_bmesh_init_pool(&bm->pdata, bm_mesh_allocsize_default.totface); + CustomData_bmesh_init_pool(&bm->vdata, me->totvert, BM_VERT); + CustomData_bmesh_init_pool(&bm->edata, me->totedge, BM_EDGE); + CustomData_bmesh_init_pool(&bm->ldata, me->totloop, BM_LOOP); + CustomData_bmesh_init_pool(&bm->pdata, me->totpoly, BM_FACE); for (i = 0, mvert = me->mvert; i < me->totvert; i++, mvert++) { v = BM_vert_create(bm, keyco && set_key ? keyco[i] : mvert->co, NULL); |