3 ms·
Whenever I need to do bit manipulations, I always check the Linux kernel source. I figure that any bit manipulation I'd ever want to do is also done in the kern
by scott_s 17y ago
Whenever I need to do bit manipulations, I always check the Linux kernel source. I figure that any bit manipulation I'd ever want to do is also done in the kernel, and I'm usually right:
http://miller.cs.wm.edu/lxr3.linux/http/source/include/linux/bitops.h?v=2.6.11.12 http://miller.cs.wm.edu/lxr3.linux/http/source/include/linux...
http://miller.cs.wm.edu/lxr3.linux/http/source/include/linux/bitmap.h?v=2.6.11.12 http://miller.cs.wm.edu/lxr3.linux/http/source/include/linux...
http://miller.cs.wm.edu/lxr3.linux/http/source/lib/bitmap.c?v=2.6.11.12 http://miller.cs.wm.edu/lxr3.linux/http/source/lib/bitmap.c?...
- electronslave 17y agoSeconded. That's probably one of the best places to find bit twiddling resouces ever. I remember I had one of those Coriolis kernel printout books back in the 90s, and I used to crib from that, some hashing function and the page allocator all the time.
- pkrumins 17y agoThese are great, I had forgotten about them!
- scott_s 17y agoThe Linux kernel is a fantastic resource. Any time I need to do some systems programming that I haven't done before, I check to see how it's done in the kernel.