__bitmap_shift_left(9)
β¨ __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 π₯
- Kernel file
./lib/bitmap.cπ§ bitmap introduction(9)πΈ__bitmap_shift_right(9)(the twin, the mirror, the other direction π)bitmap_cut(9)bitmap_find_next_zero_area_off(9)bitmap_pos_to_ord(9)bitmap_remap(9)bitmap_bitremap(9)bitmap_onto(9)bitmap_fold(9)bitmap_from_arr32(9)bitmap_to_arr32(9)bitmap_from_arr64(9)bitmap_to_arr64(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms