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/windowmanager | |
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/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 89c0cde2e88..a109c2cbd7b 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -226,7 +226,7 @@ void WM_uilisttype_freelink(uiListType *ult) /* called on initialize WM_init() */ void WM_uilisttype_init(void) { - uilisttypes_hash = BLI_ghash_str_new("uilisttypes_hash gh"); + uilisttypes_hash = BLI_ghash_str_new_ex("uilisttypes_hash gh", 16); } void WM_uilisttype_free(void) @@ -279,7 +279,8 @@ void WM_menutype_freelink(MenuType *mt) /* called on initialize WM_init() */ void WM_menutype_init(void) { - menutypes_hash = BLI_ghash_str_new("menutypes_hash gh"); + /* reserve size is set based on blender default setup */ + menutypes_hash = BLI_ghash_str_new_ex("menutypes_hash gh", 512); } void WM_menutype_free(void) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 7af69670cd4..a68d6daa96f 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -4142,7 +4142,8 @@ void wm_operatortype_free(void) /* called on initialize WM_init() */ void wm_operatortype_init(void) { - global_ops_hash = BLI_ghash_str_new("wm_operatortype_init gh"); + /* reserve size is set based on blender default setup */ + global_ops_hash = BLI_ghash_str_new_ex("wm_operatortype_init gh", 2048); WM_operatortype_append(WM_OT_window_duplicate); WM_operatortype_append(WM_OT_read_history); |