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

Function dictTryExpand

src/dict.cpp:342–348  ·  view source on GitHub ↗

return DICT_ERR if expand failed due to memory allocation failure */

Source from the content-addressed store, hash-verified

340
341/* return DICT_ERR if expand failed due to memory allocation failure */
342int dictTryExpand(dict *d, unsigned long size, bool fShrink) {
343 int malloc_failed;
344 // External expand likely means mass insertion, and we don't want to shrink during that
345 d->noshrink = true;
346 _dictExpand(d, size, fShrink, &malloc_failed);
347 return malloc_failed? DICT_ERR : DICT_OK;
348}
349
350/* Performs N steps of incremental rehashing. Returns 1 if there are still
351 * keys to move from the old to the new hash table, otherwise 0 is returned.

Callers 1

rdbLoadObjectFunction · 0.85

Calls 1

_dictExpandFunction · 0.85

Tested by

no test coverage detected