Skip to content

Commit

Permalink
mask_asm: Disable for now until v1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nhooyr committed Apr 7, 2024
1 parent 0edbb28 commit c97fb09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 0 additions & 2 deletions mask.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
// to be in little endian.
//
// See https://github.com/golang/go/issues/31586
//
//lint:ignore U1000 mask.go
func maskGo(b []byte, key uint32) uint32 {
if len(b) >= 8 {
key64 := uint64(key)<<32 | uint64(key)
Expand Down
13 changes: 9 additions & 4 deletions mask_asm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
package websocket

func mask(b []byte, key uint32) uint32 {
if len(b) > 0 {
return maskAsm(&b[0], len(b), key)
}
return key
// TODO: Will enable in v1.9.0.
return maskGo(b, key)
/*
if len(b) > 0 {
return maskAsm(&b[0], len(b), key)
}
return key
*/
}

// @nhooyr: I am not confident that the amd64 or the arm64 implementations of this
Expand All @@ -18,4 +22,5 @@ func mask(b []byte, key uint32) uint32 {
// See https://github.com/nhooyr/websocket/pull/326#issuecomment-1771138049
//
//go:noescape
//lint:ignore U1000 disabled till v1.9.0
func maskAsm(b *byte, len int, key uint32) uint32

0 comments on commit c97fb09

Please sign in to comment.