JSUOutputStream Matching for shield (#2825)

* JSUOutputStream Matching for shield

* Fix nonmatching in JAUSectionHeap
This commit is contained in:
hatal175
2025-11-19 20:17:26 +02:00
committed by GitHub
parent b55f0c63c7
commit a8d792acf8
5 changed files with 28 additions and 17 deletions
@@ -29,7 +29,7 @@ public:
__bitset_base() { data = 0; }
bool test(size_t pos) const { return data & (1 << pos); }
bool any() const;
bool any() const { return data != 0; }
void set(size_t pos, bool val) { data |= (1 << pos); }
void reset(size_t pos) { data &= ~(1 << pos); }
private:
@@ -62,6 +62,15 @@ template<size_t N> void __bitset_base<N>::reset(size_t pos) {
data[i] &= ~mask;
}
template<size_t N> bool __bitset_base<N>::any() const {
for (int i = 0; i < N; i++) {
if (data[i] != 0) {
return true;
}
}
return false;
}
template<size_t N> class bitset : private __bitset_base<(N - 1) / (sizeof(size_t) * 8) + 1> {
public:
typedef __bitset_base<(N - 1) / (sizeof(size_t) * 8) + 1> base;
@@ -86,7 +95,9 @@ public:
}
return base::test(pos);
}
bool any() const;
bool any() const {
return base::any();
}
};
} // namespace std