55 if (idx >= overflow_.size()) {
56 overflow_.resize(idx + 1, 0);
68 if (idx < overflow_.size()) {
80 if (idx >= overflow_.size())
return false;
92 [[nodiscard]]
bool none()
const {
93 if (inline_[0] != 0 || inline_[1] != 0)
return false;
94 for (
auto w : overflow_) {
95 if (w != 0)
return false;
104 template<
typename Func>
107 u64 word = inline_[w];
109 u32 bit = ctz64(word);
114 for (
u32 i = 0; i < overflow_.size(); ++i) {
115 u64 word = overflow_[i];
117 u32 bit = ctz64(word);
126 static u32 ctz64(
u64 val) {
131#if defined(__GNUC__) || defined(__clang__)
132 return static_cast<u32>(__builtin_ctzll(val));
133#elif defined(_MSC_VER)
135 _BitScanForward64(&idx, val);
136 return static_cast<u32>(idx);
139 while ((val & 1) == 0) { val >>= 1; ++count; }
145 std::vector<u64> overflow_;
Logging utilities for ESEngine.
#define ES_VERIFY(cond,...)
Always-on boundary guard — the release-safe counterpart to ES_ASSERT.
Core type definitions and utilities for ESEngine.
static constexpr u32 INLINE_WORDS
void clear(u32 bit)
Clears the given bit.
static constexpr u32 BITS_PER_WORD
bool test(u32 bit) const
Tests the given bit.
void reset()
Clears all bits.
void set(u32 bit)
Sets the given bit.
static constexpr u32 INLINE_BITS
bool none() const
Returns true if no bits are set.
void forEachSet(Func &&fn) const
Iterates all set bits, calling fn(bitIndex) for each.
std::uint64_t u64
Unsigned 64-bit integer.
std::uint32_t u32
Unsigned 32-bit integer.