Initialize the hash table */
| 118 | |
| 119 | /* Initialize the hash table */ |
| 120 | int _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). |
no test coverage detected