diff options
| author | 2025-10-09 14:05:54 +0200 | |
|---|---|---|
| committer | 2025-10-09 14:05:54 +0200 | |
| commit | 9df18e9b384a56902ef1517bc269b8c345149e12 (patch) | |
| tree | 9bea4f13167e2996813578a121bd4f4e8fde5290 /common.h | |
| parent | c1ab2a12cdaec4b701f2f9f994a174a6b838212c (diff) | |
c: call memset for some runtime zero initializations
Diffstat (limited to 'common.h')
| -rw-r--r-- | common.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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) { |