[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44596] trunk/blender/source/blender: minor edits to last commit - use fixed chunksize, rather than the number of verts/edges/faces in bm_mempool_init().

Campbell Barton ideasman42 at gmail.com
Fri Mar 2 00:59:38 CET 2012


Revision: 44596
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44596
Author:   campbellbarton
Date:     2012-03-01 23:59:34 +0000 (Thu, 01 Mar 2012)
Log Message:
-----------
minor edits to last commit - use fixed chunksize, rather than the number of verts/edges/faces in bm_mempool_init().

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/customdata.c
    trunk/blender/source/blender/bmesh/intern/bmesh_mesh.c
    trunk/blender/source/blender/bmesh/intern/bmesh_mesh.h

Modified: trunk/blender/source/blender/blenkernel/intern/customdata.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/customdata.c	2012-03-01 23:14:51 UTC (rev 44595)
+++ trunk/blender/source/blender/blenkernel/intern/customdata.c	2012-03-01 23:59:34 UTC (rev 44596)
@@ -2119,11 +2119,10 @@
 	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;

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_mesh.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_mesh.c	2012-03-01 23:14:51 UTC (rev 44595)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_mesh.c	2012-03-01 23:59:34 UTC (rev 44596)
@@ -45,13 +45,14 @@
 
 /* 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);

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_mesh.h
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_mesh.h	2012-03-01 23:14:51 UTC (rev 44595)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_mesh.h	2012-03-01 23:59:34 UTC (rev 44596)
@@ -53,5 +53,6 @@
 } BMAllocTemplate;
 
 extern BMAllocTemplate bm_mesh_allocsize_default;
+extern BMAllocTemplate bm_mesh_chunksize_default;
 
 #endif /* __BMESH_MESH_H__ */




More information about the Bf-blender-cvs mailing list