Rehash in ms+"delta" milliseconds. The value of "delta" is larger * than 0, and is smaller than 1 in most cases. The exact upper bound * depends on the running time of dictRehash(d,100).*/
| 331 | * than 0, and is smaller than 1 in most cases. The exact upper bound |
| 332 | * depends on the running time of dictRehash(d,100).*/ |
| 333 | int HashTableRehashMilliseconds(dict *d, int ms) { |
| 334 | if (d->pauserehash > 0) return 0; |
| 335 | |
| 336 | long long start = timeInMilliseconds(); |
| 337 | int rehashes = 0; |
| 338 | |
| 339 | while(HashTableRehash(d,100)) { |
| 340 | rehashes += 100; |
| 341 | if (timeInMilliseconds()-start > ms) break; |
| 342 | } |
| 343 | return rehashes; |
| 344 | } |
| 345 | |
| 346 | /* This function performs just a step of rehashing, and only if hashing has |
| 347 | * not been paused for our hash table. When we have iterators in the |
nothing calls this directly
no test coverage detected