diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-05-30 11:00:03 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2016-06-08 22:45:40 +0300 |
commit | 5b6364503139bba5d11a12db7d6e9f090d1698ec (patch) | |
tree | 1a2b1fd6ca4f4d813efc8c997b78d778fbca0abe | |
parent | fcfd739214930eefbb56eb32d3bbaa9c0cbc9cf9 (diff) |
Change the hash-table to be 3x total items to hash
-rw-r--r-- | source/blender/blenlib/intern/array_store.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/array_store.c b/source/blender/blenlib/intern/array_store.c index 9db90dcbb05..7f657f4a048 100644 --- a/source/blender/blenlib/intern/array_store.c +++ b/source/blender/blenlib/intern/array_store.c @@ -175,9 +175,9 @@ # define HASH_TABLE_KEY_FALLBACK ((uint64_t)-2) #endif -/* How much smaller the table is then the total number of steps. +/* How much larger the table is then the total number of chunks. */ -#define BCHUNK_HASH_TABLE_DIV 16 +#define BCHUNK_HASH_TABLE_MUL 3 /* Merge too small/large chunks: * @@ -1140,14 +1140,14 @@ static BChunkList *bchunk_list_from_data_merge( hash_key *table_hash_array = NULL; #endif - const size_t table_len = MAX2(1u, (((data_len - i_prev) / info->chunk_stride)) / BCHUNK_HASH_TABLE_DIV); - BTableRef **table = MEM_callocN(table_len * sizeof(*table), __func__); - const uint chunk_list_reference_remaining_len = (chunk_list_reference->chunk_refs_len - chunk_list_reference_skip_len) + 1; BTableRef *table_ref_stack = MEM_mallocN(chunk_list_reference_remaining_len * sizeof(BTableRef), __func__); uint table_ref_stack_n = 0; + const size_t table_len = chunk_list_reference_remaining_len * BCHUNK_HASH_TABLE_MUL; + BTableRef **table = MEM_callocN(table_len * sizeof(*table), __func__); + /* table_make - inline * include one matching chunk, to allow for repeating values */ { |