sbitmap_weight(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, this is sbitmap_weight(9) from the Kernel API Manual, and it is lowkey iconic for being exactly what it says 🫢. It returns how many set and not cleared bits are living in a &struct sbitmap β€” no cap, just the count, and it's giving tiny-but-mighty main character energy ✨.


🌸 SYNOPSIS 🌸

the whole signature is literally:

unsigned int sbitmap_weight (const struct sbitmap *sb );

πŸŽ€ ARGUMENTS πŸŽ€

  • sb β€” Bitmap to check. That's the one job, and it ate πŸ’….

πŸ¦‹ RETURN πŸ¦‹

How many set and not cleared bits set β€” yes, that's the number coming back at you, bestie. The count of set-and-not-cleared bits, periodt πŸ”₯.

🌈 SEE ALSO 🌈

Kernel file ./include/linux/sbitmap.h, plus the whole friend group β€” iykyk πŸ‘‘:


source/version: ./include/linux Β· date: October 2026 β€” signed, sealed, slayed πŸ’… sbitmap_weight(9) out, bestie πŸ’–πŸ‘‘

πŸ“¦ where this page comes from