MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / htNeedsResize

Function htNeedsResize

src/server.cpp:1670–1677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1668};
1669
1670int htNeedsResize(dict *dict) {
1671 long long size, used;
1672
1673 size = dictSlots(dict);
1674 used = dictSize(dict);
1675 return (size > DICT_HT_INITIAL_SIZE &&
1676 (used*100/size < HASHTABLE_MIN_FILL));
1677}
1678
1679/* If the percentage of used slots in the HT reaches HASHTABLE_MIN_FILL
1680 * we resize the hash table to save memory */

Callers 6

tryResizeMethod · 0.85
hashTypeDeleteFunction · 0.85
zsetDelFunction · 0.85
zremrangeGenericCommandFunction · 0.85
zdiffAlgorithm2Function · 0.85
setTypeRemoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected