MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / mi_clz

Function mi_clz

3rd/mimalloc-2.0.9/include/mimalloc-internal.h:947–954  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

945#include <limits.h> // LONG_MAX
946#define MI_HAVE_FAST_BITSCAN
947static 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}
955static inline size_t mi_ctz(uintptr_t x) {
956 if (x==0) return MI_INTPTR_BITS;
957#if (INTPTR_MAX == LONG_MAX)

Callers 2

mi_bsrFunction · 0.85

Calls 1

mi_clz32Function · 0.85

Tested by

no test coverage detected