From 9df18e9b384a56902ef1517bc269b8c345149e12 Mon Sep 17 00:00:00 2001 From: lemon Date: Thu, 9 Oct 2025 14:05:54 +0200 Subject: c: call memset for some runtime zero initializations --- common.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common.h') diff --git a/common.h b/common.h index 4587315..f9cc203 100644 --- a/common.h +++ b/common.h @@ -484,6 +484,14 @@ bsunion(struct bitset dst[/*siz*/], const struct bitset src[/*siz*/], uint siz) while (siz--) dst++->u |= src++->u; } +static inline uint +bscount(struct bitset bs[/*siz*/], uint siz) +{ + uint n = 0; + while (siz--) n += popcnt(bs++->u); + return n; +} + static inline bool bsiter(uint *i, struct bitset bs[/*siz*/], uint siz) { -- cgit v1.2.3