stubs_go120.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // +build go1.20
  2. /*
  3. * Copyright 2021 ByteDance Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package decoder
  18. import (
  19. `unsafe`
  20. `reflect`
  21. _ `github.com/cloudwego/base64x`
  22. `github.com/bytedance/sonic/internal/rt`
  23. )
  24. //go:linkname _subr__b64decode github.com/cloudwego/base64x._subr__b64decode
  25. var _subr__b64decode uintptr
  26. // runtime.maxElementSize
  27. const _max_map_element_size uintptr = 128
  28. func mapfast(vt reflect.Type) bool {
  29. return vt.Elem().Size() <= _max_map_element_size
  30. }
  31. //go:nosplit
  32. //go:linkname throw runtime.throw
  33. //goland:noinspection GoUnusedParameter
  34. func throw(s string)
  35. //go:linkname convT64 runtime.convT64
  36. //goland:noinspection GoUnusedParameter
  37. func convT64(v uint64) unsafe.Pointer
  38. //go:linkname convTslice runtime.convTslice
  39. //goland:noinspection GoUnusedParameter
  40. func convTslice(v []byte) unsafe.Pointer
  41. //go:linkname convTstring runtime.convTstring
  42. //goland:noinspection GoUnusedParameter
  43. func convTstring(v string) unsafe.Pointer
  44. //go:noescape
  45. //go:linkname memequal runtime.memequal
  46. //goland:noinspection GoUnusedParameter
  47. func memequal(a unsafe.Pointer, b unsafe.Pointer, size uintptr) bool
  48. //go:noescape
  49. //go:linkname memmove runtime.memmove
  50. //goland:noinspection GoUnusedParameter
  51. func memmove(to unsafe.Pointer, from unsafe.Pointer, n uintptr)
  52. //go:linkname mallocgc runtime.mallocgc
  53. //goland:noinspection GoUnusedParameter
  54. func mallocgc(size uintptr, typ *rt.GoType, needzero bool) unsafe.Pointer
  55. //go:linkname makeslice runtime.makeslice
  56. //goland:noinspection GoUnusedParameter
  57. func makeslice(et *rt.GoType, len int, cap int) unsafe.Pointer
  58. //go:noescape
  59. //go:linkname growslice reflect.growslice
  60. //goland:noinspection GoUnusedParameter
  61. func growslice(et *rt.GoType, old rt.GoSlice, cap int) rt.GoSlice
  62. //go:linkname makemap_small runtime.makemap_small
  63. func makemap_small() unsafe.Pointer
  64. //go:linkname mapassign runtime.mapassign
  65. //goland:noinspection GoUnusedParameter
  66. func mapassign(t *rt.GoMapType, h unsafe.Pointer, k unsafe.Pointer) unsafe.Pointer
  67. //go:linkname mapassign_fast32 runtime.mapassign_fast32
  68. //goland:noinspection GoUnusedParameter
  69. func mapassign_fast32(t *rt.GoMapType, h unsafe.Pointer, k uint32) unsafe.Pointer
  70. //go:linkname mapassign_fast64 runtime.mapassign_fast64
  71. //goland:noinspection GoUnusedParameter
  72. func mapassign_fast64(t *rt.GoMapType, h unsafe.Pointer, k uint64) unsafe.Pointer
  73. //go:linkname mapassign_fast64ptr runtime.mapassign_fast64ptr
  74. //goland:noinspection GoUnusedParameter
  75. func mapassign_fast64ptr(t *rt.GoMapType, h unsafe.Pointer, k unsafe.Pointer) unsafe.Pointer
  76. //go:linkname mapassign_faststr runtime.mapassign_faststr
  77. //goland:noinspection GoUnusedParameter
  78. func mapassign_faststr(t *rt.GoMapType, h unsafe.Pointer, s string) unsafe.Pointer
  79. //go:nosplit
  80. //go:linkname memclrHasPointers runtime.memclrHasPointers
  81. //goland:noinspection GoUnusedParameter
  82. func memclrHasPointers(ptr unsafe.Pointer, n uintptr)
  83. //go:noescape
  84. //go:linkname memclrNoHeapPointers runtime.memclrNoHeapPointers
  85. //goland:noinspection GoUnusedParameter
  86. func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)