diff options
author | 2023-11-27 13:15:03 +0000 | |
---|---|---|
committer | 2023-11-27 13:15:03 +0000 | |
commit | 66b77acb1c8b86f0be3836ccaf31683c0bfa317a (patch) | |
tree | 9a255a8ea8ef97229b6d75d17de45bdac1755be9 /vendor/github.com/chenzhuoyu/base64x/faststr.go | |
parent | [bugfix] Add Actor to outgoing poll vote Create; other fixes (#2384) (diff) | |
download | gotosocial-66b77acb1c8b86f0be3836ccaf31683c0bfa317a.tar.xz |
[chore]: Bump github.com/gin-contrib/cors from 1.4.0 to 1.5.0 (#2388)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/chenzhuoyu/base64x/faststr.go')
-rw-r--r-- | vendor/github.com/chenzhuoyu/base64x/faststr.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/github.com/chenzhuoyu/base64x/faststr.go b/vendor/github.com/chenzhuoyu/base64x/faststr.go index 83b58ea1f..7334b063b 100644 --- a/vendor/github.com/chenzhuoyu/base64x/faststr.go +++ b/vendor/github.com/chenzhuoyu/base64x/faststr.go @@ -21,3 +21,15 @@ func str2mem(s string) (v []byte) { func mem2addr(v []byte) unsafe.Pointer { return *(*unsafe.Pointer)(unsafe.Pointer(&v)) } + +// NoEscape hides a pointer from escape analysis. NoEscape is +// the identity function but escape analysis doesn't think the +// output depends on the input. NoEscape is inlined and currently +// compiles down to zero instructions. +// USE CAREFULLY! +//go:nosplit +//goland:noinspection GoVetUnsafePointer +func noEscape(p unsafe.Pointer) unsafe.Pointer { + x := uintptr(p) + return unsafe.Pointer(x ^ 0) +} |