TODO: clz optimization */ Our hash table capability is a power of two */
| 1077 | /* TODO: clz optimization */ |
| 1078 | /* Our hash table capability is a power of two */ |
| 1079 | static 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'. |
no outgoing calls
no test coverage detected