From 370075c256e755dcd5ff062861e6ceb055080ad6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 13:44:53 +0000 Subject: [PATCH] build(deps): bump github.com/puzpuzpuz/xsync/v2 from 2.5.0 to 2.5.1 Bumps [github.com/puzpuzpuz/xsync/v2](https://github.com/puzpuzpuz/xsync) from 2.5.0 to 2.5.1. - [Release notes](https://github.com/puzpuzpuz/xsync/releases) - [Commits](https://github.com/puzpuzpuz/xsync/compare/v2.5.0...v2.5.1) --- updated-dependencies: - dependency-name: github.com/puzpuzpuz/xsync/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/puzpuzpuz/xsync/v2/util.go | 16 ++++++++++++---- vendor/modules.txt | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index f2c83dcd2..22b69c4df 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/golang/protobuf v1.5.3 github.com/lib/pq v1.10.9 github.com/pkg/errors v0.9.1 - github.com/puzpuzpuz/xsync/v2 v2.5.0 + github.com/puzpuzpuz/xsync/v2 v2.5.1 github.com/smartystreets/assertions v1.13.1 github.com/smartystreets/goconvey v1.8.1 github.com/soheilhy/cmux v0.1.5 diff --git a/go.sum b/go.sum index 8eb35e863..98638fcc3 100644 --- a/go.sum +++ b/go.sum @@ -384,8 +384,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/puzpuzpuz/xsync/v2 v2.5.0 h1:2k4qrO/orvmEXZ3hmtHqIy9XaQtPTwzMZk1+iErpE8c= -github.com/puzpuzpuz/xsync/v2 v2.5.0/go.mod h1:gD2H2krq/w52MfPLE+Uy64TzJDVY7lP2znR9qmR35kU= +github.com/puzpuzpuz/xsync/v2 v2.5.1 h1:mVGYAvzDSu52+zaGyNjC+24Xw2bQi3kTr4QJ6N9pIIU= +github.com/puzpuzpuz/xsync/v2 v2.5.1/go.mod h1:gD2H2krq/w52MfPLE+Uy64TzJDVY7lP2znR9qmR35kU= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= diff --git a/vendor/github.com/puzpuzpuz/xsync/v2/util.go b/vendor/github.com/puzpuzpuz/xsync/v2/util.go index 81a596a1d..d8a64f8f8 100644 --- a/vendor/github.com/puzpuzpuz/xsync/v2/util.go +++ b/vendor/github.com/puzpuzpuz/xsync/v2/util.go @@ -2,7 +2,9 @@ package xsync import ( "hash/maphash" + "reflect" "runtime" + "unsafe" _ "unsafe" ) @@ -44,12 +46,18 @@ func parallelism() uint32 { // hashString calculates a hash of s with the given seed. func hashString(seed maphash.Seed, s string) uint64 { - var h maphash.Hash - h.SetSeed(seed) - h.WriteString(s) - return h.Sum64() + seed64 := *(*uint64)(unsafe.Pointer(&seed)) + if s == "" { + return seed64 + } + strh := (*reflect.StringHeader)(unsafe.Pointer(&s)) + return uint64(memhash(unsafe.Pointer(strh.Data), uintptr(seed64), uintptr(strh.Len))) } +//go:noescape +//go:linkname memhash runtime.memhash +func memhash(p unsafe.Pointer, h, s uintptr) uintptr + //go:noescape //go:linkname fastrand runtime.fastrand func fastrand() uint32 diff --git a/vendor/modules.txt b/vendor/modules.txt index ad1fb3d7c..902edbfc9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -262,7 +262,7 @@ github.com/prometheus/common/model github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/puzpuzpuz/xsync/v2 v2.5.0 +# github.com/puzpuzpuz/xsync/v2 v2.5.1 ## explicit; go 1.18 github.com/puzpuzpuz/xsync/v2 # github.com/rogpeppe/go-internal v1.11.0