-> New memory allocator for Bmesh
Added a new pooling allocator for Bmesh based upon the pool allocator availible in the Boost C++ library as described here: http://www.boost.org/doc/libs/1_34_0/libs/pool/doc/concepts.html Each pool allocates elements of a fixed size, so every element type in a mesh gets its own pool. For instance verts occupy a different pool than edges. Each pool is comprised of multiple arrays of a fixed size and allocating /freeing elements is simple as removing or adding a head to a linked list. Since the list of free elements is interleaved throughout the unused space in the arrays, the overhead for storing the free list is only 1 pointer total per pool. This makes building/destroying bmesh structures much faster and saves quite a bit of memory as well.
This commit is contained in:
@@ -4497,7 +4497,7 @@ void bevel_menu() {
|
||||
while(G.editBMesh->options & BME_BEVEL_RUNNING) {
|
||||
options = G.editBMesh->options;
|
||||
res = G.editBMesh->res;
|
||||
bm = BME_make_mesh();
|
||||
bm = BME_make_mesh(512,512,2048,512);
|
||||
bm = BME_editmesh_to_bmesh(G.editMesh, bm);
|
||||
BIF_undo_push("Pre-Bevel");
|
||||
free_editMesh(G.editMesh);
|
||||
|
||||
Reference in New Issue
Block a user