Documentation
¶
Overview ¶
Package bitfield provides bit-field access helpers.
Bit numbering: bit k of the memory at base is bit (k % 8) of byte (k / 8), where bit 0 of a byte is its least significant bit (little-endian bit allocation, as on x86-64 and AArch64).
Unsigned, Signed and Set require 1 <= width <= 64 and touch only the bytes that contain at least one bit of the range [off, off+width). A range of up to 64 bits can span 9 bytes when it is not byte-aligned; that case is handled explicitly. The helpers are not atomic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Set ¶
Set replaces bits off .. off+width-1 of the memory at base with the low width bits of v. All other bits are left unchanged.
Types ¶
This section is empty.