snapshot: sagernet/gvisor v0.0.0-20250811.0-sing-box-mod.1
Содержимое пина, зафиксированного в go.mod sing-box-lx, одним коммитом без истории. Полная история SagerNet/gvisor — 1.45 ГБ и клонируется в каждой CI-джобе; наша дельта — одна вставка в одну функцию, история для неё не нужна. Module path github.com/sagernet/gvisor сохранён намеренно: на него опирается replace-директива суперпроекта. Патч поверх — отдельным коммитом, чтобы дельта читалась одним git show и переносилась на новый пин копированием. SPECS/TASKS/048-GVISOR_HANDSHAKE_NIL_CRASH
This commit is contained in:
commit
2c4ae3b0a4
712 changed files with 185689 additions and 0 deletions
33
pkg/bits/bits64.go
Normal file
33
pkg/bits/bits64.go
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package bits
|
||||
|
||||
// IsOn returns true if *all* bits set in 'bits' are set in 'mask'.
|
||||
func IsOn64(mask, bits uint64) bool {
|
||||
return mask&bits == bits
|
||||
}
|
||||
|
||||
// IsAnyOn returns true if *any* bit set in 'bits' is set in 'mask'.
|
||||
func IsAnyOn64(mask, bits uint64) bool {
|
||||
return mask&bits != 0
|
||||
}
|
||||
|
||||
// Mask returns a T with all of the given bits set.
|
||||
func Mask64(is ...int) uint64 {
|
||||
ret := uint64(0)
|
||||
for _, i := range is {
|
||||
ret |= MaskOf64(i)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
// MaskOf is like Mask, but sets only a single bit (more efficiently).
|
||||
func MaskOf64(i int) uint64 {
|
||||
return uint64(1) << uint64(i)
|
||||
}
|
||||
|
||||
// IsPowerOfTwo returns true if v is power of 2.
|
||||
func IsPowerOfTwo64(v uint64) bool {
|
||||
if v == 0 {
|
||||
return false
|
||||
}
|
||||
return v&(v-1) == 0
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue