Because we may need to allocate huge memory chunk at once when dict * expands, we will check this allocation is allowed or not if the dict * type has expandAllowed member function. */
| 1041 | * expands, we will check this allocation is allowed or not if the dict |
| 1042 | * type has expandAllowed member function. */ |
| 1043 | static int dictTypeExpandAllowed(dict *d) { |
| 1044 | if (d->type->expandAllowed == NULL) return 1; |
| 1045 | return d->type->expandAllowed( |
| 1046 | DICTHT_SIZE(_dictNextExp(d->ht_used[0] + 1)) * sizeof(dictEntry*), |
| 1047 | (double)d->ht_used[0] / DICTHT_SIZE(d->ht_size_exp[0])); |
| 1048 | } |
| 1049 | |
| 1050 | /* Expand the hash table if needed */ |
| 1051 | static int _HashTableExpandIfNeeded |
no test coverage detected