From 9130023cf57297b702eba57b91bcceabd27bf796 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 15 May 2025 15:15:23 -0400 Subject: [PATCH] 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. --- gc/default/default.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gc/default/default.c b/gc/default/default.c index db8ee7834f..fdbedd48d4 100644 --- a/gc/default/default.c +++ b/gc/default/default.c @@ -15,7 +15,11 @@ # include #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"