MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / dictTypeExpandAllowed

Function dictTypeExpandAllowed

src/util/dict.c:1043–1048  ·  view source on GitHub ↗

Because we may need to allocate huge memory chunk at once when dict * expands, we will check this allocation is allowed or not if the dict * type has expandAllowed member function. */

Source from the content-addressed store, hash-verified

1041 * expands, we will check this allocation is allowed or not if the dict
1042 * type has expandAllowed member function. */
1043static int dictTypeExpandAllowed(dict *d) {
1044 if (d->type->expandAllowed == NULL) return 1;
1045 return d->type->expandAllowed(
1046 DICTHT_SIZE(_dictNextExp(d->ht_used[0] + 1)) * sizeof(dictEntry*),
1047 (double)d->ht_used[0] / DICTHT_SIZE(d->ht_size_exp[0]));
1048}
1049
1050/* Expand the hash table if needed */
1051static int _HashTableExpandIfNeeded

Callers 1

_HashTableExpandIfNeededFunction · 0.85

Calls 1

_dictNextExpFunction · 0.85

Tested by

no test coverage detected