MCPcopy Create free account
hub / github.com/NetSys/bess / MaskBytesSmall

Function MaskBytesSmall

core/utils/bits.h:114–119  ·  view source on GitHub ↗

Applies the `len`-byte bitmask `mask` to `buf`, in 1-byte chunks.

Source from the content-addressed store, hash-verified

112
113// Applies the `len`-byte bitmask `mask` to `buf`, in 1-byte chunks.
114static inline void MaskBytesSmall(uint8_t *buf, const uint8_t *mask,
115 const size_t len) {
116 for (size_t i = 0; i < len; i++) {
117 buf[i] &= mask[i];
118 }
119}
120
121// Applies the `len`-byte bitmask `mask` to `buf`, in 8-byte chunks if able,
122// otherwise, falls back to 1-byte chunks.

Callers 3

MaskBytes64Function · 0.85
MaskBytesFunction · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68