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

Function dictResize

src/dict.cpp:186–195  ·  view source on GitHub ↗

Resize the table to the minimal size that contains all the elements, * but with the invariant of a USED/BUCKETS ratio near to <= 1 */

Source from the content-addressed store, hash-verified

184/* Resize the table to the minimal size that contains all the elements,
185 * but with the invariant of a USED/BUCKETS ratio near to <= 1 */
186int dictResize(dict *d)
187{
188 unsigned long minimal;
189
190 if (!dict_can_resize || dictIsRehashing(d)) return DICT_ERR;
191 minimal = d->ht[0].used;
192 if (minimal < DICT_HT_INITIAL_SIZE)
193 minimal = DICT_HT_INITIAL_SIZE;
194 return _dictExpand(d, minimal, false /*fShirnk*/, nullptr);
195}
196
197int dictMerge(dict *dst, dict *src)
198{

Callers 7

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

Calls 1

_dictExpandFunction · 0.85

Tested by

no test coverage detected