mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
* Bump github.com/klauspost/compress from 1.17.3 to 1.17.6 Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.17.3 to 1.17.6. - [Release notes](https://github.com/klauspost/compress/releases) - [Changelog](https://github.com/klauspost/compress/blob/master/.goreleaser.yml) - [Commits](https://github.com/klauspost/compress/compare/v1.17.3...v1.17.6) --- updated-dependencies: - dependency-name: github.com/klauspost/compress dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * please * Update serverless gomod * Empty-Commit --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jennie Pham <[email protected]> Co-authored-by: grafanabot <[email protected]>
27 lines
511 B
Go
27 lines
511 B
Go
// 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])))
|
|
}
|