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. */
| 1338 | * expands, we will check this allocation is allowed or not if the dict |
| 1339 | * type has expandAllowed member function. */ |
| 1340 | static int dictTypeExpandAllowed(dict *d) { |
| 1341 | if (d->type->expandAllowed == NULL) return 1; |
| 1342 | return d->type->expandAllowed( |
| 1343 | _dictNextPower(d->ht[0].used + 1) * sizeof(dictEntry*), |
| 1344 | (double)d->ht[0].used / d->ht[0].size); |
| 1345 | } |
| 1346 | |
| 1347 | /* Expand the hash table if needed */ |
| 1348 | static int _dictExpandIfNeeded(dict *d) |
no test coverage detected