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

Function _dictInit

src/dict.cpp:120–133  ·  view source on GitHub ↗

Initialize the hash table */

Source from the content-addressed store, hash-verified

118
119/* Initialize the hash table */
120int _dictInit(dict *d, dictType *type,
121 void *privDataPtr)
122{
123 _dictReset(&d->ht[0]);
124 _dictReset(&d->ht[1]);
125 d->type = type;
126 d->privdata = privDataPtr;
127 d->rehashidx = -1;
128 d->pauserehash = 0;
129 d->asyncdata = nullptr;
130 d->refcount = 1;
131 d->noshrink = false;
132 return DICT_OK;
133}
134
135/* Expand or create the hash table,
136 * when malloc_failed is non-NULL, it'll avoid panic if malloc fails (in which case it'll be set to 1).

Callers 1

dictCreateFunction · 0.70

Calls 1

_dictResetFunction · 0.70

Tested by

no test coverage detected