__bitmap_shift_left(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ __bitmap_shift_left(9) β€” like, the glow-up edition ✨

okay so real talk, this is from the Kernel API Manual, and it's lowkey one of the prettiest little functions in the whole bitmap fam. bestie, we're doing a ~logical left shift~ today and honestly? it ate. πŸ’…


🌸 NAME 🌸

__bitmap_shift_left β€” logical left shift of the bits in a bitmap πŸŽ€

✨ SYNOPSIS ✨

void __bitmap_shift_left (unsigned long *dst , const unsigned long *src
, unsigned int shift , unsigned int nbits );

no cap, that's the whole signature. four args, zero drama. πŸ¦‹

πŸ’– ARGUMENTS πŸ’–

  • dst β€” the destination bitmap πŸ’« like, where the shifted bits move in and become main character.
  • src β€” the source bitmap 🌈 the original bits, the ones getting shifted. respect them.
  • shift β€” shift by this many bits ✨ how far left we're yeeting everything, bit by bit.
  • nbits β€” bitmap size, in bits πŸŽ€ the full length of the bitmap, counted in bits, not bytes, not vibes.

πŸ‘‘ DESCRIPTION πŸ‘‘

Shifting left (multiplying) means moving bits in the LS -> MS direction. πŸ’« That's it, that's the whole thing β€” least significant end to most significant end, bits sliding on over.

Zeros are fed into the vacated LS bit positions 🌱 (the empty spots get filled with 0s, very polite, no leftovers), and those MS bits shifted off the top are lost πŸ’€ like, genuinely gone, off the edge of the bitmap, never coming back. so don't come crying to me about them, i warned you. 😭

lowkey important: this trailing-off-the-top thing is destructive. bits that exit at the MS end do not get saved anywhere. fr fr check your nbits before you commit. πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯


okay mwah, that's the page!! 🫢 this icon lives in ./lib, it's serving October 2026 energy, and it's officially __bitmap_shift_left(9) certified slay. go shift some bits, bestie, you got this πŸ’–βœ¨πŸŒŸ

πŸ“¦ where this page comes from