minor edits to last commit - use fixed chunksize, rather than the number of verts...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 1 Mar 2012 23:59:34 +0000 (23:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 1 Mar 2012 23:59:34 +0000 (23:59 +0000)
source/blender/blenkernel/intern/customdata.c
source/blender/bmesh/intern/bmesh_mesh.c
source/blender/bmesh/intern/bmesh_mesh.h

index 7b1b5e7dd375151a66813aba87bf8831dd88e80b..cd15c56cea115014160d31e64c1e5d5e099309e5 100644 (file)
@@ -2119,11 +2119,10 @@ void CustomData_bmesh_init_pool(CustomData *data, int totelem, const char htype)
        BLI_assert(data->pool == NULL);
 
        switch (htype) {
-               case BM_VERT: chunksize = 512;  break;
-               case BM_EDGE: chunksize = 1024; break;
-               case BM_LOOP: chunksize = 2048; break;
-               case BM_FACE: chunksize = 512;  break;
-               case BM_ALL: chunksize  = 512;  break; /* use this when its undefined */
+               case BM_VERT: chunksize = bm_mesh_chunksize_default.totvert;  break;
+               case BM_EDGE: chunksize = bm_mesh_chunksize_default.totedge;  break;
+               case BM_LOOP: chunksize = bm_mesh_chunksize_default.totloop;  break;
+               case BM_FACE: chunksize = bm_mesh_chunksize_default.totface;  break;
                default:
                        BLI_assert(0);
                        chunksize = 512;
index b8d30f725096e91cee11ec57ea937a5ce1f5bb49..92ee2221b6e677991b004c3dda032de7b5a2f521 100644 (file)
 
 /* used as an extern, defined in bmesh.h */
 BMAllocTemplate bm_mesh_allocsize_default = {512, 1024, 2048, 512};
+BMAllocTemplate bm_mesh_chunksize_default = {512, 1024, 2048, 512};
 
 static void bm_mempool_init(BMesh *bm, const BMAllocTemplate *allocsize)
 {
-       bm->vpool = BLI_mempool_create(sizeof(BMVert), allocsize->totvert, allocsize->totvert, BLI_MEMPOOL_ALLOW_ITER);
-       bm->epool = BLI_mempool_create(sizeof(BMEdge), allocsize->totedge, allocsize->totedge, BLI_MEMPOOL_ALLOW_ITER);
-       bm->lpool = BLI_mempool_create(sizeof(BMLoop), allocsize->totloop, allocsize->totloop, 0);
-       bm->fpool = BLI_mempool_create(sizeof(BMFace), allocsize->totface, allocsize->totface, BLI_MEMPOOL_ALLOW_ITER);
+       bm->vpool = BLI_mempool_create(sizeof(BMVert), allocsize->totvert, bm_mesh_chunksize_default.totvert, BLI_MEMPOOL_ALLOW_ITER);
+       bm->epool = BLI_mempool_create(sizeof(BMEdge), allocsize->totedge, bm_mesh_chunksize_default.totedge, BLI_MEMPOOL_ALLOW_ITER);
+       bm->lpool = BLI_mempool_create(sizeof(BMLoop), allocsize->totloop, bm_mesh_chunksize_default.totloop, 0);
+       bm->fpool = BLI_mempool_create(sizeof(BMFace), allocsize->totface, bm_mesh_chunksize_default.totface, BLI_MEMPOOL_ALLOW_ITER);
 
 #ifdef USE_BMESH_HOLES
        bm->looplistpool = BLI_mempool_create(sizeof(BMLoopList), allocsize[3], allocsize[3], FALSE, FALSE);
index ea80696a85528a594ecff012044b70056ea37c62..d045cd8be903954fd4958ec989f581940aa838fb 100644 (file)
@@ -53,5 +53,6 @@ typedef struct BMAllocTemplate {
 } BMAllocTemplate;
 
 extern BMAllocTemplate bm_mesh_allocsize_default;
+extern BMAllocTemplate bm_mesh_chunksize_default;
 
 #endif /* __BMESH_MESH_H__ */