diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-24 21:33:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-24 21:33:47 +0400 |
commit | 09a52f18b6d8bd77cbffd746f72e866e1740505f (patch) | |
tree | 525d2cd2121cd5e7112bcb26ffcca0445d979328 /source/blender/editors | |
parent | 7bd422143e2ebab4f37fd8647206ec5d2235259e (diff) |
ghash: reserve size when its known or can be guessed close enough.
also avoid allocs per node in pbvh_bmesh_node_limit_ensure()
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 660f8098a38..01559a007ef 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -674,7 +674,7 @@ static GHash *dupli_keyIndexHash(GHash *keyindex) GHash *gh; GHashIterator *hashIter; - gh = BLI_ghash_ptr_new("dupli_keyIndex gh"); + gh = BLI_ghash_ptr_new_ex("dupli_keyIndex gh", BLI_ghash_size(keyindex)); for (hashIter = BLI_ghashIterator_new(keyindex); BLI_ghashIterator_done(hashIter) == false; diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 4ae48b99bb8..ce1cacdfb3a 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -1135,7 +1135,7 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em) mesh_octree_table(ob, em, NULL, 'e'); - fhash = BLI_ghash_new(mirror_facehash, mirror_facecmp, "mirror_facehash gh"); + fhash = BLI_ghash_new_ex(mirror_facehash, mirror_facecmp, "mirror_facehash gh", me->totface); for (a = 0, mf = mface; a < me->totface; a++, mf++) BLI_ghash_insert(fhash, mf, mf); |