diff options
Diffstat (limited to 'vendor/github.com/klauspost/compress/internal')
5 files changed, 0 insertions, 141 deletions
diff --git a/vendor/github.com/klauspost/compress/internal/le/le.go b/vendor/github.com/klauspost/compress/internal/le/le.go deleted file mode 100644 index e54909e16..000000000 --- a/vendor/github.com/klauspost/compress/internal/le/le.go +++ /dev/null @@ -1,5 +0,0 @@ -package le - -type Indexer interface { - int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 -} diff --git a/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go b/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go deleted file mode 100644 index 0cfb5c0e2..000000000 --- a/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build !(amd64 || arm64 || ppc64le || riscv64) || nounsafe || purego || appengine - -package le - -import ( - "encoding/binary" -) - -// Load8 will load from b at index i. -func Load8[I Indexer](b []byte, i I) byte { - return b[i] -} - -// Load16 will load from b at index i. -func Load16[I Indexer](b []byte, i I) uint16 { - return binary.LittleEndian.Uint16(b[i:]) -} - -// Load32 will load from b at index i. -func Load32[I Indexer](b []byte, i I) uint32 { - return binary.LittleEndian.Uint32(b[i:]) -} - -// Load64 will load from b at index i. -func Load64[I Indexer](b []byte, i I) uint64 { - return binary.LittleEndian.Uint64(b[i:]) -} - -// Store16 will store v at b. -func Store16(b []byte, v uint16) { - binary.LittleEndian.PutUint16(b, v) -} - -// Store32 will store v at b. -func Store32(b []byte, v uint32) { - binary.LittleEndian.PutUint32(b, v) -} - -// Store64 will store v at b. -func Store64(b []byte, v uint64) { - binary.LittleEndian.PutUint64(b, v) -} diff --git a/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go b/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go deleted file mode 100644 index ada45cd90..000000000 --- a/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go +++ /dev/null @@ -1,55 +0,0 @@ -// We enable 64 bit LE platforms: - -//go:build (amd64 || arm64 || ppc64le || riscv64) && !nounsafe && !purego && !appengine - -package le - -import ( - "unsafe" -) - -// Load8 will load from b at index i. -func Load8[I Indexer](b []byte, i I) byte { - //return binary.LittleEndian.Uint16(b[i:]) - //return *(*uint16)(unsafe.Pointer(&b[i])) - return *(*byte)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) -} - -// Load16 will load from b at index i. -func Load16[I Indexer](b []byte, i I) uint16 { - //return binary.LittleEndian.Uint16(b[i:]) - //return *(*uint16)(unsafe.Pointer(&b[i])) - return *(*uint16)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) -} - -// Load32 will load from b at index i. -func Load32[I Indexer](b []byte, i I) uint32 { - //return binary.LittleEndian.Uint32(b[i:]) - //return *(*uint32)(unsafe.Pointer(&b[i])) - return *(*uint32)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) -} - -// Load64 will load from b at index i. -func Load64[I Indexer](b []byte, i I) uint64 { - //return binary.LittleEndian.Uint64(b[i:]) - //return *(*uint64)(unsafe.Pointer(&b[i])) - return *(*uint64)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) -} - -// Store16 will store v at b. -func Store16(b []byte, v uint16) { - //binary.LittleEndian.PutUint16(b, v) - *(*uint16)(unsafe.Pointer(unsafe.SliceData(b))) = v -} - -// Store32 will store v at b. -func Store32(b []byte, v uint32) { - //binary.LittleEndian.PutUint32(b, v) - *(*uint32)(unsafe.Pointer(unsafe.SliceData(b))) = v -} - -// Store64 will store v at b. -func Store64(b []byte, v uint64) { - //binary.LittleEndian.PutUint64(b, v) - *(*uint64)(unsafe.Pointer(unsafe.SliceData(b))) = v -} diff --git a/vendor/github.com/klauspost/compress/internal/race/norace.go b/vendor/github.com/klauspost/compress/internal/race/norace.go deleted file mode 100644 index affbbbb59..000000000 --- a/vendor/github.com/klauspost/compress/internal/race/norace.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !race - -package race - -func ReadSlice[T any](s []T) { -} - -func WriteSlice[T any](s []T) { -} diff --git a/vendor/github.com/klauspost/compress/internal/race/race.go b/vendor/github.com/klauspost/compress/internal/race/race.go deleted file mode 100644 index f5e240dcd..000000000 --- a/vendor/github.com/klauspost/compress/internal/race/race.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build race - -package race - -import ( - "runtime" - "unsafe" -) - -func ReadSlice[T any](s []T) { - if len(s) == 0 { - return - } - runtime.RaceReadRange(unsafe.Pointer(&s[0]), len(s)*int(unsafe.Sizeof(s[0]))) -} - -func WriteSlice[T any](s []T) { - if len(s) == 0 { - return - } - runtime.RaceWriteRange(unsafe.Pointer(&s[0]), len(s)*int(unsafe.Sizeof(s[0]))) -} |
