Remove dependency on bits.h in default.c when BUILDING_MODULAR_GC

We can assume that the compiler will have __builtin_clzll so we can implement
nlz_int64 using that.
This commit is contained in:
Peter Zhu 2025-05-15 15:15:23 -04:00
parent 4f9f2243e9
commit 9130023cf5
Notes: git 2025-05-23 18:36:11 +00:00

View File

@ -15,7 +15,11 @@
# include <sys/user.h>
#endif
#include "internal/bits.h"
#ifdef BUILDING_MODULAR_GC
# define nlz_int64(x) (x == 0 ? 64 : (unsigned int)__builtin_clzll((unsigned long long)x))
#else
# include "internal/bits.h"
#endif
#include "ruby/ruby.h"
#include "ruby/atomic.h"