| 945 | #include <limits.h> // LONG_MAX |
| 946 | #define MI_HAVE_FAST_BITSCAN |
| 947 | static inline size_t mi_clz(uintptr_t x) { |
| 948 | if (x==0) return MI_INTPTR_BITS; |
| 949 | #if (INTPTR_MAX == LONG_MAX) |
| 950 | return __builtin_clzl(x); |
| 951 | #else |
| 952 | return __builtin_clzll(x); |
| 953 | #endif |
| 954 | } |
| 955 | static inline size_t mi_ctz(uintptr_t x) { |
| 956 | if (x==0) return MI_INTPTR_BITS; |
| 957 | #if (INTPTR_MAX == LONG_MAX) |
no test coverage detected