diff options
author | 2024-03-11 10:12:06 +0000 | |
---|---|---|
committer | 2024-03-11 10:12:06 +0000 | |
commit | e24efcac8b67baa9454bf27631e5e49f898a88d4 (patch) | |
tree | d9adec2f05e1d8714edee66062a4b95a81ee2a61 /vendor/github.com/bytedance/sonic/internal/rt | |
parent | [bugfix] Fix whitespace move_id issue (#2742) (diff) | |
download | gotosocial-e24efcac8b67baa9454bf27631e5e49f898a88d4.tar.xz |
[chore]: Bump github.com/gin-contrib/cors from 1.5.0 to 1.7.0 (#2745)
Diffstat (limited to 'vendor/github.com/bytedance/sonic/internal/rt')
-rw-r--r-- | vendor/github.com/bytedance/sonic/internal/rt/asm_amd64.s | 3 | ||||
-rw-r--r-- | vendor/github.com/bytedance/sonic/internal/rt/asm_compat.s (renamed from vendor/github.com/bytedance/sonic/internal/rt/asm_arm64.s) | 3 | ||||
-rw-r--r-- | vendor/github.com/bytedance/sonic/internal/rt/fastmem.go | 3 | ||||
-rw-r--r-- | vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go | 21 | ||||
-rw-r--r-- | vendor/github.com/bytedance/sonic/internal/rt/int48.go | 6 |
5 files changed, 28 insertions, 8 deletions
diff --git a/vendor/github.com/bytedance/sonic/internal/rt/asm_amd64.s b/vendor/github.com/bytedance/sonic/internal/rt/asm_amd64.s index 8250e38d3..4998d5f79 100644 --- a/vendor/github.com/bytedance/sonic/internal/rt/asm_amd64.s +++ b/vendor/github.com/bytedance/sonic/internal/rt/asm_amd64.s @@ -1,5 +1,4 @@ -// +build !noasm !appengine -// Code generated by asm2asm, DO NOT EDIT· +// +build !noasm,amd64 !appengine,amd64 #include "go_asm.h" #include "funcdata.h" diff --git a/vendor/github.com/bytedance/sonic/internal/rt/asm_arm64.s b/vendor/github.com/bytedance/sonic/internal/rt/asm_compat.s index a168a8266..7d50b6483 100644 --- a/vendor/github.com/bytedance/sonic/internal/rt/asm_arm64.s +++ b/vendor/github.com/bytedance/sonic/internal/rt/asm_compat.s @@ -1,5 +1,4 @@ -// +build !noasm !appengine -// Code generated by asm2asm, DO NOT EDIT. +// +build !noasm,!amd64 !appengine,!amd64 #include "go_asm.h" #include "funcdata.h" diff --git a/vendor/github.com/bytedance/sonic/internal/rt/fastmem.go b/vendor/github.com/bytedance/sonic/internal/rt/fastmem.go index e3bf0db91..a68d98aff 100644 --- a/vendor/github.com/bytedance/sonic/internal/rt/fastmem.go +++ b/vendor/github.com/bytedance/sonic/internal/rt/fastmem.go @@ -66,15 +66,16 @@ func FuncAddr(f interface{}) unsafe.Pointer { } } +//go:nocheckptr func IndexChar(src string, index int) unsafe.Pointer { return unsafe.Pointer(uintptr((*GoString)(unsafe.Pointer(&src)).Ptr) + uintptr(index)) } +//go:nocheckptr func IndexByte(ptr []byte, index int) unsafe.Pointer { return unsafe.Pointer(uintptr((*GoSlice)(unsafe.Pointer(&ptr)).Ptr) + uintptr(index)) } -//go:nosplit func GuardSlice(buf *[]byte, n int) { c := cap(*buf) l := len(*buf) diff --git a/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go b/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go index 2b2757f5b..befaeb715 100644 --- a/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go +++ b/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go @@ -211,3 +211,24 @@ func findReflectRtypeItab() *GoItab { v := reflect.TypeOf(struct{}{}) return (*GoIface)(unsafe.Pointer(&v)).Itab } + +func AssertI2I2(t *GoType, i GoIface) (r GoIface) { + inter := IfaceType(t) + tab := i.Itab + if tab == nil { + return + } + if (*GoInterfaceType)(tab.it) != inter { + tab = Getitab(inter, tab.Vt, true) + if tab == nil { + return + } + } + r.Itab = tab + r.Value = i.Value + return +} + +//go:noescape +//go:linkname Getitab runtime.getitab +func Getitab(inter *GoInterfaceType, typ *GoType, canfail bool) *GoItab diff --git a/vendor/github.com/bytedance/sonic/internal/rt/int48.go b/vendor/github.com/bytedance/sonic/internal/rt/int48.go index e9f82d731..a0eb64ad7 100644 --- a/vendor/github.com/bytedance/sonic/internal/rt/int48.go +++ b/vendor/github.com/bytedance/sonic/internal/rt/int48.go @@ -17,12 +17,12 @@ package rt const ( - MinInt48 = -(1 << 47) - MaxInt48 = +(1 << 47) - 1 + MinInt48 int64 = -(1 << 47) + MaxInt48 int64 = +(1 << 47) - 1 ) func PackInt(v int) uint64 { - if u := uint64(v); v < MinInt48 || v > MaxInt48 { + if u := uint64(v); int64(v) < MinInt48 || int64(v) > MaxInt48 { panic("int48 out of range") } else { return ((u >> 63) << 47) | (u & 0x00007fffffffffff) |