mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] Update all but bun libraries (#526)
* update all but bun libraries Signed-off-by: kim <grufwub@gmail.com> * remove my personal build script changes Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
3
vendor/github.com/ugorji/go/codec/binc.go
generated
vendored
3
vendor/github.com/ugorji/go/codec/binc.go
generated
vendored
@ -811,6 +811,9 @@ func (d *bincDecDriver) DecodeBytes(bs []byte) (bsOut []byte) {
|
||||
for i := 0; i < slen; i++ {
|
||||
bs[i] = uint8(chkOvf.UintV(d.DecodeUint64(), 8))
|
||||
}
|
||||
for i := len(bs); i < slen; i++ {
|
||||
bs = append(bs, uint8(chkOvf.UintV(d.DecodeUint64(), 8)))
|
||||
}
|
||||
return bs
|
||||
}
|
||||
var clen int
|
||||
|
3
vendor/github.com/ugorji/go/codec/cbor.go
generated
vendored
3
vendor/github.com/ugorji/go/codec/cbor.go
generated
vendored
@ -610,6 +610,9 @@ func (d *cborDecDriver) DecodeBytes(bs []byte) (bsOut []byte) {
|
||||
for i := 0; i < len(bs); i++ {
|
||||
bs[i] = uint8(chkOvf.UintV(d.DecodeUint64(), 8))
|
||||
}
|
||||
for i := len(bs); i < slen; i++ {
|
||||
bs = append(bs, uint8(chkOvf.UintV(d.DecodeUint64(), 8)))
|
||||
}
|
||||
return bs
|
||||
}
|
||||
clen := d.decLen()
|
||||
|
8
vendor/github.com/ugorji/go/codec/decimal.go
generated
vendored
8
vendor/github.com/ugorji/go/codec/decimal.go
generated
vendored
@ -132,12 +132,20 @@ var fi64 = floatinfo{52, 22, 15, false, 1<<52 - 1}
|
||||
var fi64u = floatinfo{0, 19, 0, true, fUint64Cutoff}
|
||||
|
||||
func noFrac64(fbits uint64) bool {
|
||||
if fbits == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
exp := uint64(fbits>>52)&0x7FF - 1023 // uint(x>>shift)&mask - bias
|
||||
// clear top 12+e bits, the integer part; if the rest is 0, then no fraction.
|
||||
return exp < 52 && fbits<<(12+exp) == 0 // means there's no fractional part
|
||||
}
|
||||
|
||||
func noFrac32(fbits uint32) bool {
|
||||
if fbits == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
exp := uint32(fbits>>23)&0xFF - 127 // uint(x>>shift)&mask - bias
|
||||
// clear top 9+e bits, the integer part; if the rest is 0, then no fraction.
|
||||
return exp < 23 && fbits<<(9+exp) == 0 // means there's no fractional part
|
||||
|
2
vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl
generated
vendored
2
vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl
generated
vendored
@ -78,7 +78,7 @@ if {{var "l"}} == 0 {
|
||||
{{var "v"}} = {{var "v"}}[:{{var "j"}}]
|
||||
{{var "c"}} = true
|
||||
} else if {{var "j"}} == 0 && {{var "v"}} == nil {
|
||||
{{var "v"}} = make([]{{ .Typ }}, 0)
|
||||
{{var "v"}} = []{{ .Typ }}{}
|
||||
{{var "c"}} = true
|
||||
}
|
||||
{{end -}}
|
||||
|
2
vendor/github.com/ugorji/go/codec/gen.generated.go
generated
vendored
2
vendor/github.com/ugorji/go/codec/gen.generated.go
generated
vendored
@ -149,7 +149,7 @@ if {{var "l"}} == 0 {
|
||||
{{var "v"}} = {{var "v"}}[:{{var "j"}}]
|
||||
{{var "c"}} = true
|
||||
} else if {{var "j"}} == 0 && {{var "v"}} == nil {
|
||||
{{var "v"}} = make([]{{ .Typ }}, 0)
|
||||
{{var "v"}} = []{{ .Typ }}{}
|
||||
{{var "c"}} = true
|
||||
}
|
||||
{{end -}}
|
||||
|
43
vendor/github.com/ugorji/go/codec/helper.go
generated
vendored
43
vendor/github.com/ugorji/go/codec/helper.go
generated
vendored
@ -943,13 +943,18 @@ func (x *basicHandleRuntimeState) setExt(rt reflect.Type, tag uint64, ext Ext) (
|
||||
}
|
||||
|
||||
rtid := rt2id(rt)
|
||||
// handle all natively supported type appropriately, so they cannot have an extension.
|
||||
// However, we do not return an error for these, as we do not document that.
|
||||
// Instead, we silently treat as a no-op, and return.
|
||||
switch rtid {
|
||||
case timeTypId, rawTypId, rawExtTypId:
|
||||
// these are all natively supported type, so they cannot have an extension.
|
||||
// However, we do not return an error for these, as we do not document that.
|
||||
// Instead, we silently treat as a no-op, and return.
|
||||
case rawTypId, rawExtTypId:
|
||||
return
|
||||
case timeTypId:
|
||||
if x.timeBuiltin {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
for i := range x.extHandle {
|
||||
v := &x.extHandle[i]
|
||||
if v.rtid == rtid {
|
||||
@ -1966,7 +1971,7 @@ func (ti *typeInfo) init(x []structFieldInfo, n int) {
|
||||
// Handling flagCanTransient
|
||||
//
|
||||
// We support transient optimization if the kind of the type is
|
||||
// a number, bool, string, or slice.
|
||||
// a number, bool, string, or slice (of number/bool).
|
||||
// In addition, we also support if the kind is struct or array,
|
||||
// and the type does not contain any pointers recursively).
|
||||
//
|
||||
@ -1976,15 +1981,20 @@ func (ti *typeInfo) init(x []structFieldInfo, n int) {
|
||||
// when GC tries to follow a "transient" pointer which may become a non-pointer soon after.
|
||||
//
|
||||
|
||||
func isCanTransient(t reflect.Type, k reflect.Kind) (v bool) {
|
||||
var bs *bitset32
|
||||
func transientBitsetFlags() *bitset32 {
|
||||
if transientValueHasStringSlice {
|
||||
bs = &numBoolStrSliceBitset
|
||||
} else {
|
||||
bs = &numBoolBitset
|
||||
return &numBoolStrSliceBitset
|
||||
}
|
||||
return &numBoolBitset
|
||||
}
|
||||
|
||||
func isCanTransient(t reflect.Type, k reflect.Kind) (v bool) {
|
||||
var bs = transientBitsetFlags()
|
||||
if bs.isset(byte(k)) {
|
||||
v = true
|
||||
} else if k == reflect.Slice {
|
||||
elem := t.Elem()
|
||||
v = numBoolBitset.isset(byte(elem.Kind()))
|
||||
} else if k == reflect.Array {
|
||||
elem := t.Elem()
|
||||
v = isCanTransient(elem, elem.Kind())
|
||||
@ -2010,8 +2020,7 @@ func (ti *typeInfo) doSetFlagCanTransient() {
|
||||
ti.flagCanTransient = true
|
||||
}
|
||||
if ti.flagCanTransient {
|
||||
// if ti kind is a num, bool, string or slice, then it is flagCanTransient
|
||||
if !numBoolStrSliceBitset.isset(ti.kind) {
|
||||
if !transientBitsetFlags().isset(ti.kind) {
|
||||
ti.flagCanTransient = isCanTransient(ti.rt, reflect.Kind(ti.kind))
|
||||
}
|
||||
}
|
||||
@ -2472,13 +2481,19 @@ func panicValToErr(h errDecorator, v interface{}, err *error) {
|
||||
}
|
||||
|
||||
func usableByteSlice(bs []byte, slen int) (out []byte, changed bool) {
|
||||
const maxCap = 1024 * 1024 * 64 // 64MB
|
||||
const skipMaxCap = false // allow to test
|
||||
if slen <= 0 {
|
||||
return []byte{}, true
|
||||
}
|
||||
if cap(bs) < slen {
|
||||
if slen <= cap(bs) {
|
||||
return bs[:slen], false
|
||||
}
|
||||
// slen > cap(bs) ... handle memory overload appropriately
|
||||
if skipMaxCap || slen <= maxCap {
|
||||
return make([]byte, slen), true
|
||||
}
|
||||
return bs[:slen], false
|
||||
return make([]byte, maxCap), true
|
||||
}
|
||||
|
||||
func mapKeyFastKindFor(k reflect.Kind) mapKeyFastKind {
|
||||
|
1
vendor/github.com/ugorji/go/codec/helper_unsafe.go
generated
vendored
1
vendor/github.com/ugorji/go/codec/helper_unsafe.go
generated
vendored
@ -376,6 +376,7 @@ func i2rtid(i interface{}) uintptr {
|
||||
// --------------------------
|
||||
|
||||
func unsafeCmpZero(ptr unsafe.Pointer, size int) bool {
|
||||
// verified that size is always within right range, so no chance of OOM
|
||||
var s1 = unsafeString{ptr, size}
|
||||
var s2 = unsafeString{unsafeZeroAddr, size}
|
||||
if size > len(unsafeZeroArr) {
|
||||
|
3
vendor/github.com/ugorji/go/codec/msgpack.go
generated
vendored
3
vendor/github.com/ugorji/go/codec/msgpack.go
generated
vendored
@ -851,6 +851,9 @@ func (d *msgpackDecDriver) DecodeBytes(bs []byte) (bsOut []byte) {
|
||||
for i := 0; i < len(bs); i++ {
|
||||
bs[i] = uint8(chkOvf.UintV(d.DecodeUint64(), 8))
|
||||
}
|
||||
for i := len(bs); i < slen; i++ {
|
||||
bs = append(bs, uint8(chkOvf.UintV(d.DecodeUint64(), 8)))
|
||||
}
|
||||
return bs
|
||||
} else {
|
||||
d.d.errorf("invalid byte descriptor for decoding bytes, got: 0x%x", d.bd)
|
||||
|
6
vendor/github.com/ugorji/go/codec/reader.go
generated
vendored
6
vendor/github.com/ugorji/go/codec/reader.go
generated
vendored
@ -8,9 +8,11 @@ import "io"
|
||||
// decReader abstracts the reading source, allowing implementations that can
|
||||
// read from an io.Reader or directly off a byte slice with zero-copying.
|
||||
type decReader interface {
|
||||
// readx will use the implementation scratch buffer if possible i.e. n < len(scratchbuf), OR
|
||||
// just return a view of the []byte being decoded from.
|
||||
// readx will return a view of the []byte if decoding from a []byte, OR
|
||||
// read into the implementation scratch buffer if possible i.e. n < len(scratchbuf), OR
|
||||
// create a new []byte and read into that
|
||||
readx(n uint) []byte
|
||||
|
||||
readb([]byte)
|
||||
|
||||
readn1() byte
|
||||
|
3
vendor/github.com/ugorji/go/codec/simple.go
generated
vendored
3
vendor/github.com/ugorji/go/codec/simple.go
generated
vendored
@ -449,6 +449,9 @@ func (d *simpleDecDriver) DecodeBytes(bs []byte) (bsOut []byte) {
|
||||
for i := 0; i < len(bs); i++ {
|
||||
bs[i] = uint8(chkOvf.UintV(d.DecodeUint64(), 8))
|
||||
}
|
||||
for i := len(bs); i < slen; i++ {
|
||||
bs = append(bs, uint8(chkOvf.UintV(d.DecodeUint64(), 8)))
|
||||
}
|
||||
return bs
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user