summaryrefslogtreecommitdiff
path: root/vendor/github.com/klauspost/compress/s2/encode_amd64.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/klauspost/compress/s2/encode_amd64.go')
-rw-r--r--vendor/github.com/klauspost/compress/s2/encode_amd64.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/github.com/klauspost/compress/s2/encode_amd64.go b/vendor/github.com/klauspost/compress/s2/encode_amd64.go
index ebc332ad5..4f45206a4 100644
--- a/vendor/github.com/klauspost/compress/s2/encode_amd64.go
+++ b/vendor/github.com/klauspost/compress/s2/encode_amd64.go
@@ -3,6 +3,8 @@
package s2
+import "github.com/klauspost/compress/internal/race"
+
const hasAmd64Asm = true
// encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It
@@ -14,6 +16,9 @@ const hasAmd64Asm = true
// len(dst) >= MaxEncodedLen(len(src)) &&
// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize
func encodeBlock(dst, src []byte) (d int) {
+ race.ReadSlice(src)
+ race.WriteSlice(dst)
+
const (
// Use 12 bit table when less than...
limit12B = 16 << 10
@@ -50,6 +55,9 @@ func encodeBlock(dst, src []byte) (d int) {
// len(dst) >= MaxEncodedLen(len(src)) &&
// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize
func encodeBlockBetter(dst, src []byte) (d int) {
+ race.ReadSlice(src)
+ race.WriteSlice(dst)
+
const (
// Use 12 bit table when less than...
limit12B = 16 << 10
@@ -86,6 +94,9 @@ func encodeBlockBetter(dst, src []byte) (d int) {
// len(dst) >= MaxEncodedLen(len(src)) &&
// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize
func encodeBlockSnappy(dst, src []byte) (d int) {
+ race.ReadSlice(src)
+ race.WriteSlice(dst)
+
const (
// Use 12 bit table when less than...
limit12B = 16 << 10
@@ -121,6 +132,9 @@ func encodeBlockSnappy(dst, src []byte) (d int) {
// len(dst) >= MaxEncodedLen(len(src)) &&
// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize
func encodeBlockBetterSnappy(dst, src []byte) (d int) {
+ race.ReadSlice(src)
+ race.WriteSlice(dst)
+
const (
// Use 12 bit table when less than...
limit12B = 16 << 10