Return 1 if currently we allow dict to expand. Dict may allocate huge * memory to contain hash buckets when dict expands, that may lead redis * rejects user's requests or evicts some keys, we can stop dict to expand * provisionally if used memory will be over maxmemory after dict expands, * but to guarantee the performance of redis, we still allow dict to expand * if dict load factor exceeds
| 1452 | * but to guarantee the performance of redis, we still allow dict to expand |
| 1453 | * if dict load factor exceeds HASHTABLE_MAX_LOAD_FACTOR. */ |
| 1454 | int dictExpandAllowed(size_t moreMem, double usedRatio) { |
| 1455 | if (usedRatio <= HASHTABLE_MAX_LOAD_FACTOR) { |
| 1456 | return !overMaxmemoryAfterAlloc(moreMem); |
| 1457 | } else { |
| 1458 | return 1; |
| 1459 | } |
| 1460 | } |
| 1461 | |
| 1462 | void dictGCAsyncFree(dictAsyncRehashCtl *async); |
| 1463 |
nothing calls this directly
no test coverage detected