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

Function _dictNextExp

src/util/dict.c:1079–1089  ·  view source on GitHub ↗

TODO: clz optimization */ Our hash table capability is a power of two */

Source from the content-addressed store, hash-verified

1077/* TODO: clz optimization */
1078/* Our hash table capability is a power of two */
1079static signed char _dictNextExp(unsigned long size)
1080{
1081 unsigned char e = DICT_HT_INITIAL_EXP;
1082
1083 if (size >= LONG_MAX) return (8*sizeof(long)-1);
1084 while(1) {
1085 if (((unsigned long)1<<e) >= size)
1086 return e;
1087 e++;
1088 }
1089}
1090
1091/* Returns the index of a free slot that can be populated with
1092 * a hash entry for the given 'key'.

Callers 2

_HashTableExpandFunction · 0.85
dictTypeExpandAllowedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected